0% found this document useful (0 votes)
22 views3 pages

Ajp MCQ Set 6

The document contains a set of multiple-choice questions related to Java programming, specifically focusing on networking, JDBC, and servlet concepts. Each question includes four options with the correct answer indicated. The questions cover topics such as establishing connections, executing SQL queries, and handling HTTP methods.

Uploaded by

jk97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views3 pages

Ajp MCQ Set 6

The document contains a set of multiple-choice questions related to Java programming, specifically focusing on networking, JDBC, and servlet concepts. Each question includes four options with the correct answer indicated. The questions cover topics such as establishing connections, executing SQL queries, and handling HTTP methods.

Uploaded by

jk97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

SET 6

Sr
Question Option A Option B Option C Option D Answer
No
Which Java method is used to
1 establish a connection to a remote connect() open() accept() bind() A
server using TCP/IP?
Which Java class is used for
2 SocketServer ServerSocket TCPServer NetworkServer B
creating a server socket?

Which statement is used to roll back BEGIN SET


3 ROLLBACK COMMIT A
a transaction in JDBC? TRANSACTION TRANSACTION

In Java, which protocol is used for


4 HTTP FTP TCP UDP B
transferring files over the network?

Which Java class is used for


5 Socket ServerSocket DatagramSocket InetAddress B
creating network sockets?

Which of the following is used to PreparedStateme


6 DriverManager Connection ResultSet D
execute SQL queries in JDBC? nt

A server socket can connect to


7 1 2 10 multiple d
________ clients.

Select the method used to create open


8 URL Connection URL URL Decoder b
URL connection. Connection

Which HTTP method is used to


9 retrieve data from the server in a GET POST PUT DELETE A
safe way?
The_____package contains classes
that help in connecting to a
10 database, sending SQL statements connection.sql b.sql pkg.sql java.sql D
to the database and processing the
query request.
Which Java package is commonly
11 java.sql java.io java.util java.net D
used for socket programming?

Servlets handle multiple


12 simultaneous requests by using TRUE FALSE None All A
threads.

Which method is called when a sessionCreated( sessionInitialize


13 initSession() createSession() A
session is created in a servlet? ) d()

Database programming using Java


ClassNotFound
14 throws which of the following SQLException None of these Both of these D
Exception
exceptions?

Which method is used to execute a


executeUpdate(
15 query in JDBC and retrieve the executeQuery() execute() executeBatch() A
)
results in a ResultSet?

Session is part of SessionTracking


16 and maintains client state at server TRUE FALSE None All A
side?

Which method can be used to send sendResponse( HttpServletRespo


17 getRequest() getResponse() D
a response to the client in a servlet? ) nse.getWriter()

What type of servlet uses the


None of the
18 methods doGet(), doPost(), GenericServlet HttpServlet All of the above B
above
doHead(), doDelete(), doTrace()?

Which of the following is used to Connection.clos Statement.clos PreparedStateme


19 ResultSet.close() A
close a JDBC connection? e() e() nt.close()

Which port is commonly used for


20 21 80 443 8080 B
HTTP communication?

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy