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.

Q 3 - Which of the following type of JDBC driver, calls database vendor native library on a client side. This code then talks to database over network?

A - JDBC-ODBC Bridge plus ODBC driver

B - Native-API, partly Java driver

C - JDBC-Net, pure Java driver

D - Native-protocol, pure Java driver

Answer : B

Explanation

Native-API, partly Java driver calls database vendor native library on a client side. This code then talks to database over network.

Q 4 - The JDBC-ODBC Bridge support multiple concurrent open statements per connection.

A - true

B - false

Answer : B

Explanation

No. You can open only one Statement object per connection when you are using the JDBC-ODBC Bridge.

Answer : C

Explanation

PreparedStatement allows mapping different requests with same prepared statement but different arguments to execute the same execution plan. Prepared statements are more secure because they use bind variables, which can prevent SQL injection attack.

Answer : C

Explanation

A stored procedure is a group of SQL statements that form a logical unit and perform a particular task. For example operations on an employee database (hire, fire, promote, lookup) could be coded as stored procedures executed by application code. Stored procedures can be called using CallableStatement class in JDBC API.

Answer : C

Explanation

Connection Pooling is a technique used for reuse of physical connections and reduced overhead for your application. Connection pooling functionality minimizes expensive operations in the creation and closing of sessions.

Answer : D

Explanation

A disconnected RowSet object is ad-hoc in nature. Whenever it requires retrieving data from the database, it establishes the connection and closes it upon finishing the required task. The data that is modified during disconnected state is updated after the connection is re-established.

Q 9 - Which isolation level prevents dirty read in JDBC, connection class?

A - TRANSACTION_READ_COMMITTED

B - TRANSACTION_NONE

C - TRANSACTION_READ_UNCOMMITTED

D - TRANSACTION_REPEATABLE_READ

Answer : A

Explanation

TRANSACTION_READ_COMMITTED prevents dirty read in JDBC, connection class.

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