SET 4
Sr
Question Option A Option B Option C Option D Answer
No
To retrieve To manage
In JDBC, what is the purpose of the To represent a To execute SQL
database database A
ResultSetMetaData interface? result set queries
1 metadata connections
Which of the following method is
static and synchronized in JDBC getConnection() prepareCall() executeUpdate() executeQuery() A
2 API?
Which methods are required to load
getConnection() registerDriver() forName() Both b and c D
a database driver in JDBC?
Which of the following is used to Connection.clos Statement.clos PreparedStateme
ResultSet.close() A
close a JDBC connection? e() e() nt.close()
Which of the following is used to
try-catch block throws clause finally block All of the above D
handle exceptions in JDBC?
5
Which of the following is a benefit of
It prevents SQL It improves None of the
using a PreparedStatement in Both A and B C
injection performance above
JDBC?
6
In the below statement, which type
of query can be used with
Insert, Update, Insert, Select,
executeUpdate() method? Only Select Any Query A
Delete Delete
statement.executeUpdate(query
7 here)
to retain the next to retain the next
What is the purpose of the next() to retain the None of the
element in a record in a C
method? next table. above
series. series.
Resolver in DNS system maps Domain name to IP address to Domain name to MAC address to
a
__________. IP address domain name MAC address IP address
9
TCP does not support Multicasting It supports full
It provides error It provides flow It is a connection
and Broadcasting because duplex d
control. control oriented protocol
______________. communication.
10
In Java, which class is used to
IP IPAddress InetAddress InetAddressUtils C
represent an IP address?
11
Which Java library is commonly
java.net javax.servlet java.http java.httpclient D
used for making HTTP requests?
12
Uniform Unified
Uniform Restore Unified Restore
URL is an acronym for? Resource Resource a
Locator Locator
13 Locator Locator
URL stands for Uniform Resource
Locator and represents a resource
TRUE FALSE a
on the World Wide Web, such as a
14 Web page or FTP directory.
Which class is used to create
None of the
servers that listen for either local ServerSockets httpServer httpResponse a
above
15 client or remote client programs?
Which method is used to establish a
openConnection(
connection between server and accept() open() getLocalHost() a
)
16 client?
Which of these package contains
classes and interfaces for java.io java.util java.net javax.swing c
networking?
17
Which of the following is NOT a
valid HTTP response header in a Content-Type Location Session-ID Set-Cookie C
servlet?
18
To listen for To listen for To listen for To listen for
What is the purpose of the
changes in changes in changes in changes in
ServletContextListener interface in B
session servlet context request response
servlets?
attributes attributes parameters headers
19
What is the purpose of the Retrieve a Retrieve a
Retrieve a Retrieve a servlet
ServletContext.getAttribute() request response C
session attribute attribute
method? attribute attribute
20