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 : A

Explanation

JDBC stands for Java Database Connectivity.

Q 2 - Which of the following holds data retrieved from a database after you execute an SQL query using Statement objects?

A - ResultSet

B - JDBC driver

C - Connection

D - Statement

Answer : A

Explanation

ResultSet holds data retrieved from a database after you execute an SQL query using Statement objects.

Answer : D

Explanation

Native-protocol, pure Java driver, uses database native protocol.

Q 4 - Which of the following represents a regular SQL statement in JDBC?

A - Statement

B - PreparedStatement

C - CallableStatement

D - None of the above.

Answer : A

Explanation

Statement represents a regular SQL 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.

Answer : C

Explanation

A warning can be reported on a Connection object, a Statement object (including PreparedStatement and CallableStatement objects), or a ResultSet object. Each of these classes has a getWarnings method.

Answer : C

Explanation

Database vendor's help multiple clients to share a cached set of connection objects that provides access to a database. Clients need not create a new connection everytime to interact with the database.

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 : A

Explanation

These are used to store large amount of data into database like images, movie etc which are extremely large in size.

Answer : D

Explanation

Class.forName("MyClass") first loads the class MyClass then executes any static block code of MyClass and returns an instance of MyClass.


jdbc_questions_answers.htm

Advertisements