Web Services Development MCQs with Answers
Practice important Web Services Development MCQs with answers and explanations.
Multiple Choice Questions
Q511: In the provided servlet example, what is the session ID used for?
- A: To track the user
- B: To store login information
- C: To bind objects
- D: To identify a particular user
View Answer
D
Q512: Fill in the blank: In HttpSession, the method _______ is used to invalidate a session.
- A: setSession
- B: resetSession
- C: destroySession
- D: invalidate()
View Answer
D
Q513: What is the purpose of JDBC in Java?
- A: To connect and execute queries with the database
- B: To manage hardware resources
- C: To create graphical interfaces
- D: To perform multithreading operations
View Answer
A
Q514: Why was JDBC introduced over ODBC in Java?
- A: ODBC was platform-independent
- B: ODBC used C, which is platform-dependent and less secure
- C: ODBC was faster than JDBC
- D: ODBC did not support Java at all
View Answer
B
Q515: How many types of JDBC drivers are there?
- A: 2
- B: 3
- C: 4
- D: 5
View Answer
C
Q516: Which JDBC driver converts JDBC calls directly into the vendor-specific database protocol?
- A: JDBC-ODBC Bridge Driver
- B: Native-API Driver
- C: Network Protocol Driver
- D: Thin Driver
View Answer
D
Q517: What is the advantage of using the Thin Driver?
- A: Requires installation on the client-side
- B: Fully written in C
- C: Fully written in Java
- D: Needs database-specific coding
View Answer
C
Q518: In JDBC, what is used to create a connection with a database?
- A: getConnection() method
- B: createConnection() method
- C: connectDatabase() method
- D: openDatabase() method
View Answer
A
Q519: What method is used to register the driver class in JDBC?
- A: Class.forName()
- B: DriverManager.registerDriver()
- C: createDriver()
- D: loadDriver()
View Answer
A
Q520: The executeQuery() method is used for which type of SQL operation?
- A: SELECT queries
- B: INSERT queries
- C: DELETE queries
- D: UPDATE queries
View Answer
A