Advanced Java Exam Questions and Answers
Advanced Java Exam Questions and Answers
___________
Q.2 (a) Write a java program to find an IP address of the machine on which the 03
program runs.
(b) Explain difference between ServletConfig and ServletContext object. 04
(c) Write a client-server application using TCP Sockets where client can 07
send message and server respond with the reverse of them.
OR
(c) Write a Servlet that takes two numbers as an input and display all the 07
prime numbers between them. Also write [Link] description for the
servlet.
Q.3 (a) Explain ResultSetMetaData with suitable program. 03
(b) List the JSTL core tags and explain any two with example. 04
(c) What is CallableStatement? Show that how to use it to call a stored 07
procedure running at database layer.
OR
Q.3 (a) Explain DataBaseMetaData with example. 03
(b) Explain any two page directive in JSP with example. 04
(c) Explain the use of the PreparedStatement object of the JDBC with an 07
appropriate example
1
Seat No.: ________ Enrolment No.___________
GUJARAT TECHNOLOGICAL UNIVERSITY
BE - SEMESTER–VI (NEW) - EXAMINATION – SUMMER 2018
Subject Code:2160707 Date:01/05/2018
Subject Name:Advanced Java
Tim[Link] AM to 01:00 PM Total Marks: 70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
MARKS
Q.1 (a) What is hibernate? What is main advantage of using hibernate 03
than using SQL?
(b) What is JSF tag library? Explain any four html tag. 04
(c) List the different types of JDBC drivers. Compare the various 07
driver types for their advantages and disadvantages.
Q.2 (a) Compare the include and forward action tags in JSP. 03
(b) Explain the configuration of filter using deployment descriptor. 04
(c) Write Servlet program to create cookie. Also write code to display 07
contents of cookie on page.
OR
(c) Answer following. 07
1. Difference between Socket and Server Socket
2. What is Object serialization? What is need of it?
Q.3 (a) What is dependency injection? 03
(b) What is session object in JSP? Show its use with proper example 04
(c) Explain the action tags used to access the JavaBeans from a JSP page 07
with example.
OR
Q.3 (a) Write a servlet that redirect requests alternatively to JSP Pages named 03
Odd and Even
(b) What is Request Dispatcher? What is the difference between Request 04
dispatcher’s forward() and include() method?
(c) Write JSP Page to demonstrate shopping cart using session feature of 07
JSP
Q.4 (a) Explain use of action tag with example. 03
(b) What is [Link]? Explain it with code. 04
(c) Write a client server program using TCP where client sends a string 07
and server checks whether that string is palindrome or not and
responds with appropriate message.
OR
Q.4 (a) Explain architecture of Spring MVC Framework. 03
(b) What are the different methods to call java code from JSP page 04
. ? Explain them.
(c) Write a Java Servlet to print BE Semester 7 Marksheet of entered 07
enrollment number by user using JDBC.
Q.5 (a) Explain various Session tracking mechanisms in servlet with example 03
(b) Explain JSF life cycle phases. 04
(c) Design a form to input details of an employee and submit the data to a 07
servlet. Write code for servlet that will save the entered details as a
new record in database table Employee with fields (EmpId, EName,
Email, Age).
OR
1
Q.5 (a) Explain use of DatabaseMetaData with example 03
(b) Explain use of ServletConfig and ServletContext object with example. 04
(c) Write a java bean named “student” having roll no and name having 07
getter & setter methods. Write a JSP page to set the roll number and
name for a student object and then print them by reading from object.
*************
2
Seat No.: ________ Enrolment No.___________
MARKS
Q.1 (a) Write difference between statement and prepared statement interface. 03
(b) Write a sample code to store image in Database. 04
(c) Explain JDBC Transaction Management in detail. 07
Q.2 (a) List types of diver used in JDBC. Explain Thin driver. 03
(b) Write a sample code for client send a “Hello” message to server. 04
(c) What is ResultSet interface. Write various method for ResultSet interface. 07
Write a code to update record using this interface.
OR
(c) List the JSF validation tag and explain any Two. 07
Q.3 (a) List page directive in JSP? Explain any two with example 03
(b) Draw the JSF request processing life cycle and list various stage. 04
(c) List and Explain various stages of Servlet life cycle. 07
OR
Q.3 (a) Explain use of ServletConfig and ServletContext object with example 03
(b) Write difference between (1) Generic Servlet and Http Servlet (2) doGet and 04
doPost
(c) List and explain various phases of JSP life cycle? 07
Q.4 (a) Explain use of <jsp: useBean> action tag with example 03
(b) Explain Request and Response object in Servlet. 04
(c) Write a web application which takes id, name, mobile no, semester, marks, 07
percentage pass to servlet. Servlet forward to model class having method
getid(), getname(), getmobno(), getsem(), getmarks() and getPercentage().
Display all the information in .jsp page
OR
Q.4 (a) Write working of session management in servlet. 03
(b) List JSP implicit object? Explain any two with example. 04
(c) Write a student bean class with property student_id, name, semester, address 07
and percentage. Write jsp page to set and display all property
Q.5 (a) What is HQL? Write difference between HQL and SQL? 03
(b) List the JSF facelets tags and explain any two. 04
(c) Explain Spring Bean life cycle phases. 07
OR
Q.5 (a) What is Spring IoC container 03
(b) Explain working of JSF expression language. 04
(c) What is ORM? Explain object/relational mappings in hibernate 07
*************
1
Seat No.: ________ Enrolment No.___________
GUJARAT TECHNOLOGICAL UNIVERSITY
BE - SEMESTER–VI(NEW) – EXAMINATION – SUMMER 2019
Subject Code:2160707 Date:14/05/2019
Subject Name:Advanced Java
Tim[Link] AM TO 01:00 PM Total Marks: 70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks..
Q.2 (a) What do you mean by MVC architecture? Explain its role in modern 03
applications with its advantages
(b) Write a Web application using servlet to find whether entered number is 04
prime or not.
(c) Explain JSF Application Life cycle with diagram. 07
OR
(c) Explain Hibernate Architecture and Object Relation Mapping in 07
Hibernate with java code and required XML files.
Q.4 (a) Explain the following classes with their use. i. URLConnection class 03
ii. DatagramSocket (iii) DatagramPacket class
(b) Write a JSP Page which use available java bean. Discuss functionality 04
of used java beans.
(c) Develop a jsp code which reads the student detail from web page and 07
stores it in database
OR
Q.4 (a) Explain JSP (i) page (ii) include (iii) taglib directive with attribute, 03
description.
(b) Discuss JSP Exception Handling. 04
(c) Write a servlet code to demonstrate prepare statement and callable 07
statement to retrieve and store employee data.
1/2
OR
Q.5 (a) Discuss JSF Convertor Tag. 03
(b) Explain following tags in JSTL with example : (i) Core (ii)XML 04
(c) Write a Java Servlet to print BE Semester Marksheet of entered 07
enrollment number and sem no by student using JDBC.
*************
2/2
Seat No.: ________ Enrolment No.___________
Marks
Q.1 (a) What is Hibernate? What is main advantage of using hibernate 03
than using SQL?
(b) Compare Directive Include and Standard Action Include in JSP. 04
(c) Write a client server program using TCP. Client send list of N numbers 07
to server and server respond the sum of N numbers with appropriate
output.
Q.2 (a) What is a DatabaseMetaData? List out methods and explain any two with 03
appropriate code.
(b) Explain UseBean action tag in JSP with appropriate code. 04
(c) Write a program to insert student records to database using callable 07
statement with appropriate output.
Q.5 (a) What is a use of page directive tag? List out all attribute and 03
explain any two in detail.
(b) List out all Implicit object in JSP and explain any three in detail. 04
(c) What is a use of directive taglib in JSP? Write down a program 07
for creating your own tag by using taglib in JSP with appropriate
output.
1
Q.7 (a) List the JSF facelets tags and explain any one in detail. 03
(b) List the JSF validation tags and explain any three in detail. 04
(c) Explain JSF application life cycle phases in detail with neat sketch. 07
*************
2
Seat No.: ________ Enrolment No.___________
Q.1 (a) What do you mean by MVC architecture? Explain its role in modern 03
applications with its advantages.
(b) What is Servlet? Explain the life cycle methods of it. 04
(c) Explain the use of PreparedStatement with appropriate example. 07
Q.3 (a) What is a session? List out various session management techniques. 03
(b) Explain the purpose of RequestDispatcher using the methods forward () and 04
include ().
(c) What are cookies? Demonstrate the use of cookies in servlet. 07
OR
Q.3 (a) Which action tags are used to access the JavaBeans from a JSP page? 03
(b) What is Expression Language EL in JSP explain with suitable example 04
program?
(c) What is session? Demonstrate the use of Session in JSP. 07
Q.5 (a) What is hibernate? What are the benefits of using it? 03
(b) What is HQL? How does it different from SQL? List its advantages. 04
(c) Explain the Spring Web MVC framework controllers 07
OR
Q.5 (a) What are the different bean scopes in spring? 03
(b) What is Spring Bean? How can you create bean in Spring boot? 04
(c) What is OR mapping? Explain the components of [Link] file. 07
*************
1
Seat No.: ________ Enrolment No.___________
Q.2 (a) What is HTTP? Explain any two HTTP request methods in detail. 03
(b) Explain scripting elements of JSP. 04
(c) Write a program in which client sends string from its standard input to the server. 07
The server reads the string, finds number of words, characters and digits of received
string and sends result back to client. Use connection-oriented communication.
OR
(c) Write a JDBC Program for Employee Management application in which Consider 07
Employee table with attributes Emp_ID, EmpName, Phone and Address, and
perform followings:
i) Insert multiple records using prepared statement.
ii) Display all the records in reverse order.
Q.4 (a) What is difference between JSTL tag <c:import> and <jsp:include> action tag? 03
(b) Explain any four JSTL function tags with example. 04
(c) Explain the JSF request processing life cycle. 07
OR
Q.4 (a) What is [Link]? Explain it with code. 03
(b) List the JSF standard validator tags and explain any three in detail. 04
(c) Write a JSP application for student registration application using database 07
connectivity.
1 of 2
Q.5 (a) List the Hibernate annotations and explain any two Hibernate annotations in 03
detail.
(b) What is ORM? Explain object/relational mappings in hibernate. 04
(c) Explain the architecture of Spring web MVC. 07
OR
Q.5 (a) Compare Hibernate and JDBC. 03
(b) Explain Spring bean life cycle. 04
(c) Explain Hibernate Architecture. 07
*************
2 of 2
Seat No.: ________ Enrolment No.___________
Q.4 (a) What is EL? Write a code snippet to show the use of method expressions in JSP page. 03
(b) Create a custom tag to print current date and time in JSP page. 04
(c) Discuss JSF request processing life cycle. 07
OR
Q.4 (a) Write a code snippet to show the use of JSF action event. 03
(b) Create a JSF custom convertor and use it in JSP page. 04
(c) Discuss the tags of JSTL SQL tag library. 07
1
Enrolment No./Seat No_____________
MARKS
Q.1 (a) Explain URL and URLConnection class with example. 03
(b) Explain Statement and PreparedStatement with example. 04
(c) What is Request Dispatcher? What is the difference between Request 07
dispatcher’s forward() and include() method? Explain it in detail with program.
Q.2 (a) What is Deployment descriptor ([Link]) in servlet? Explain with code. 03
(b) What is JDBC? Explain the types of JDBC drivers. 04
(c) Write a client-server program using TCP/UDP sockets to echo the message send 07
by the client.
OR
(c) Write a TCP program in which client sends string from its standard input to the 07
server. The server reads the string, converts the string into upper case and sends
back to client
Q.3 (a) Explain difference between ServletConfig and ServletContext object 03
(b) Explain JSP life cycle phases. 04
(c) What is CallableStatement? Explain how to use it to call a stored procedure with 07
proper example.
OR
Q.3 (a) Compare JSP and Servlet. 03
(b) Explain Servlet Life Cycle with example and demonstrate every state in detail. 04
(c) Write a Login servlet. Take input username and password from html file 07
[Link] and authenticate the user. Write the [Link].
Q.4 (a) Explain any three JSTL Core tags. 03
(b) What is Filter? Explain Filter API. 04
(c) What is session? List and explain different ways to manage the session. 07
OR
Q.4 (a) What is difference between include directive and jsp:include action tag? 03
(b) What is HQL? Write difference between HQL and SQL. 04
(c) Draw the JSF request processing life cycle and briefly give the function of each 07
phase.
Q.5 (a) What is ORM? Explain object/relational mappings in hibernate. 03
(b) What is the JSF facelets? Explain any two facelets tags. 04
(c) Explain architecture of Spring MVC Framework. 07
OR
Q.5 (a) What is Dependency Injection? 03
(b) List the JSF validation tags and explain any two. 04
(c) Explain Hibernate architecture in detail. 07
**********************
1
Enrolment No./Seat No_______________
Q.2 (a) What are the differences between a TCP socket and UDP socket? How are they 03
created in Java?
(b) Demonstrate the use of ServletConfig and ServletContext. 04
(c) How do you handle multiple clients concurrently in socket programming? Explain 07
with example.
OR
(c) What is Session? Compare different session management techniques. 07
Q.3 (a) What is the use of PreparedStatement? How will you use it? 03
(b) What is filter? How will you configure filter using deployment descriptor? 04
(c) What is Java Bean? Demonstrate the use of JSP bean in web application. 07
OR
Q.3 (a) What is the use of CallableStatement? How will you use it? 03
(b) What is FilterConfig? How will you use it? 04
(c) What is JSTL? Explain the core tags of the SQL tag library. 07
*************
1