Enrollment No:
GSFC UNIVERSITY
SCHOOL OF TECHNOLOGY
[Link]. CSE, End Semester Examination, Even Session 2024-25
VI Date: 19/05/2025
Semester: pm
Time: 10:00 amn - 12:00
Course Code:BTCS603 Marks: 40
Total
Course Name: Advanced Java Technology
Instructions
fll marks. 3. Make suitable assumptions wherever necessary.
Atempt all questions. 2. Figures to the richt indicate
1.
(08)
Q.1
(02)
a. Two MCQs / Two fill in the blank questions. Each carry I marks.
I.
Which ofthe following statements are true about the InetAddress class in Java?
A) It represents both IP addresses and hostnames B) Itcan resolve hostnames to IP addresses
C) It isused to manage TCP connections directly D) It belongs to the [Link] package
Do you agree? The URL class in Java can represent a reference to a web resource.
b. (02)
Imagine you are designing a Java program that uses DatagramPacket to send a message to anoner
machine.
You have a receiverAddress, and a
byte array byte [] data, an InetAddress object
destination port portNumber,
Which constructor of DatagramPacket will vou use and why?Also, what changes if you are preparing
a packet to receive data instead?
Create a simple TCP server using ServerSocket that listens on port 5000 and returns "Welcome to GSFC (04)
University" to any client that connects
Q.2 (08)
a. Two MCQs / Two fill in the blank questions. Each carry l marks. (02)
Which method is used to release a JDBC connection resource?
A)release) B) terminate() C)close() D) disconnect()
Which of the following statements are true about transaction management in JDBC?
A)The commit) method is used to permanently save changes made during a transaction.
B)The rollback)method undoes all changes made during the current transactio.
C)Auto-commit mode is always enabled by default in JDBC,and cannot be changed.
D)Transactions can only be applied when using the PreparedStatement interface.
E) You can turn off auto-commit mode using setAutoCommit(false).
b.
What the purpose of the PreparedStatement interface
is in JDBC,and how does it improve performance (02)
and security over the Statement inierface?
C. import [Link].*; (04)
public class JdbcExample
public static void main(String[] args) {
Connection conn = null;
Statementstmt = null;
ResultSet rs = null;
try {
I/ Error 1: Missing database name in the connection URL
conn = [Link]("jdbe:mysql:/Mocalhost:3306", "root", "password");
stmt = [Link]():
I/ Error 2: Incorrect SQL syntax (missingtable name)
String query ="SELECT * FROM";
rs = [Link](query);
}catch (SQLException e) {
[Link]();
Find out Errors from above code and also provide solutions for the same.
Page 1 of 2
Q.3 (08)
Two MCQs / Two fill in the blank questions. Each carry marks. (02)
I
The Filter interface has the method that processes the request and response.
Which of the following is true about the doGet) method in servlets?
A)It handles HTTP GET requests only B) It is called only for POST requests
C) is a default method used for all HTTP methods D) It is used for database connection handling
lIt
b.
How does the web xml deployment deseriptor contribute to the configuration of a Java web application? (02)
Discuss its structure and mention at least five common settings defined in
it.
C.
Why is session tracking essential in web applications? List and explain methods
session,
the different to track a (04)
including their advantages and disadvantages.
a.
Two MCQs / True or OR
False / Two fill in the blank
questions. Each carry
The tag library Imarks. (02)
used in JSP to standardize
common tasks is called
True or False: Cookies are always stored
b. permanently on the client
What is the purpose of the machine.
ServletContext and ServletConfig
their roles and scope with interfaces in a web application?
examples. Compare (02)
You are developing a university portal where students must log in to access
assignments. The system must also log every
dashboards and upload (04)
request for audit purposes
users can access and ensure that only
specific pages. Your team suggests Filters. Explain
authorized
applications. Describe its role in this portal scenario what a Filter is in Java web
placing
and explain the advantagesof using filters
this logic in servlet
Q.4 or JSP. instead of
a.
Two MCQs / Two fill in the blank (08)
questions. Each carryl marks.
Which JSP tag is used to include (02)
a) <%@ include %> another JSP page dynamically?
b) <jsp:include />
What is Hibernate
primarily used for?
)sp:forward /> d) <isp:useBean >
a)Compiling Java code b) Database
connection pooling
c) Object-Relational
b. Mapping d) GUI
What are JSP implicit objects? Name any development
three.
C.
Explain Hibernate (02)
architecture. Draw a labeled diagram and explain key components.
(04)
a. Two MCQs / True or False / OR
Two fillin the blank questions. Each carry lmarks.
Trueor False: HQL is (02)
case-insensitive for keywords but
case-sensitive for class and
Which file is typically used to configure property names.
Hibernate settings?
a) [Link] b)
[Link] c) [Link]
b. List the d) [Link]
JSTL Tag Library and Explain briefly any One.
C. List and explain the life cycle stages (02)
of JSP.
Q.5 (04)
a. Two MCOs / Two fill in the blank (08)
questions. Each carry l marks.
(02)
Which annotation is used to denote a
Spring Boot application?
a) @SpringApplication b) @EnableA
utoConfiguration
c) @SpringBootApplication d) @Configuration
Which of the following is true about HL?
a) It is database-specific b) It uses SQL syntax c) It is case-sensitive d) It is object-oriented
b. Write a Hibernate configuration file ([Link]) example and explain the key elements. (02)
C. Explain the overall architecture of Spring MVC. Describe the role of each component involved in the (04)
request handling cycle.
OR
a. Two MCQs / Two fill in the blank questions. Each carry I marks.
(02)
I. What server does Spring Boot use by default?
b) JBoss c) Tomcat d)GlassFish
a) WebLogic
IL. What does SessionFactory do?
a) Handles transactions b) Opens and manages sessions
SQL scripts d) Stores the database schema
c) Creates
p-based web application that collects student information from a form (Such as name.
b. roll
using JDBC (06)
database
pumber, and department) and stores it in a
Page 2 of 2