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.
Q 1 - Which of the following is correct about Connection interface of JDBC?
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?
DriverManager class manages a list of database drivers in JDBC.
Q 3 - Which of the following type of JDBC driver, is also called Type 1 JDBC driver?
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?
QueryStatement is not a valid type of statement in JDBC.
Q 5 - Which of the following is correct about Class.forName() method call?
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 6 - Which of the following can cause 'No suitable driver' error?
All of the above can cause 'No suitable driver' error.
Q 7 - Out of String or a java.sql.Clob, which has best performance when used to manipulate data from database?
java.sql.Clob has better performance as it does not extract any data from the database until you explicitly ask it to.
Q 8 - Which of the following is correct about setFetchSize(int)?
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.
Q 9 - Resultset is an interface, how does it support rs.Next()?
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.
New drivers can be plugged-in to the JDBC API without changing the client code.