JDBC Online Quiz


Advertisements

Following quiz provides Multiple Choice Questions (MCQs) related to JDBC Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Answer : C

Explanation

Connection interface consists of methods for contacting a database. The connection object represents communication context.

Q 2 - Which of the following manages a list of database drivers in JDBC?

A - DriverManager

B - JDBC driver

C - Connection

D - Statement

Answer : A

Explanation

DriverManager class manages a list of database drivers in JDBC.

Answer : A

Explanation

JDBC-ODBC Bridge plus ODBC driver, is also called Type 1 JDBC driver.

Q 4 - Which of the following is not a valid type of statement in JDBC?

A - Statement

B - PreparedStatement

C - CallableStatement

D - QueryStatement

Answer : D

Explanation

QueryStatement is not a valid type of statement in JDBC.

Answer : C

Explanation

Class.forName(): This method dynamically loads the driver's class file into memory, which automatically registers it. This method is preferable because it allows you to make the driver registration configurable and portable.

Q 7 - Out of String or a java.sql.Clob, which has best performance when used to manipulate data from database?

A - String

B - java.sql.Clob

Answer : B

Explanation

java.sql.Clob has better performance as it does not extract any data from the database until you explicitly ask it to.

Answer : C

Explanation

setMaxRows(int) method of the ResultSet specifies how many rows a ResultSet can contain at a time. setMaxRows(int) affects the client side JDBC object.

Answer : B

Explanation

Every vendor of Database provides implementation of ResultSet & other interfaces, through the Driver.

Q 10 - New drivers can be plugged-in to the JDBC API without changing the client code.

A - true

B - false

Answer : A

Explanation

New drivers can be plugged-in to the JDBC API without changing the client code.

jdbc_questions_answers.htm
Advertisements