0% found this document useful (0 votes)
15 views13 pages

JDBCObjective Test

Uploaded by

Muskan Kateja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views13 pages

JDBCObjective Test

Uploaded by

Muskan Kateja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Ques 2 : State true or false .

Does the JDBC-ODBC Bridge support multiple


concurrent open statements per connection?
(A) False
(B) True
Ques 3 : Type-2 driver called-
(A) Native-protocol, pure Java driver
(B) JDBC-Net, pure Java driver
(C) Native-API, partly Java driver
(D) JDBC-ODBC Bridge plus ODBC driver
Ques 4 : State true or false :- The JDBC-ODBC bridge from Sun's Java
Software does not provide network access to desktop databases like
Microsoft access by itself.
(A) True
(B) False
Ques 5 : If your Java application is accessing multiple types of databases at
the same time, which type of driver is the preferred driver.

(A) Type-1
(B) Type-2
(C) Type-3
(D) Type-4
Ques 6 : JDBC-ODBC Bridge is platform independent driver.
(A) False
(B) True
Ques 7 : Which JDBC driver Type(s) is(are) the JDBC-ODBC bridge?
(A) Type 1
(B) Type 2
(C) Type 3
(D) Type 4
Ques 8 : Which type of JDBC driver is the fastest one?
(A) Type 4
(B) Type 3
(C) Type 2
(D) Type 1
Ques 9 : State true or false Can we retrieve a whole row of data at once,
instead of calling an individual ResultSet.getXXX method for each column ?
(A) True
(B) False
Ques 10 : How many types of Statement in JDBC
(A) 2
(B) 3
(C) 4
(D) 5
Ques 11 : Which JDBC driver Type(s) can you use in a three-tier architecture
and if the Web server and the DBMS are running on the same machine?
(A) Type 1 only
(B) Type 2 only
(C) Both Type 3 and Type 4
(D) All of Type 1, Type 2, Type 3 and Type 4
Ques 12 : Does the JDBC-ODBC Bridge support multiple concurrent open
statements per connection?
(A) No
(B) Yes
Ques 13 : Which isolation level prevents dirty read in JDBC, connection
class.
(A) TRANSACTION_READ_ COMMITTED
(B) TRANSACTION_UNREAD_ COMMITTED
Ques 14 : How many different types of resultset in JDBC?
(A) 1
(B) 2
(C) 3
(D) 4
Ques 15 : Which JDBC driver Type(s) can be used in either applet or servlet
code?
(A) Both Type 1 and Type 2
(B) Both Type 3 and Type 4
(C) Both Type 1 and Type 3
(D) Type 4 only
Ques 16 : Is the JDBC-ODBC Bridge multi-threaded?

(A) NO
(B) Yes
Ques 17 : Can we update a resultset programmatically?
(A) No
(B) Yes
Ques 18 : Which of the following describes the correct sequence of the
steps involved in making a connection with a database.
1. Loading the driver
2. Process the results.
3. Making the connection with the database.
4. Executing the SQL statements.
(A) 1,2,3,4
(B) 1,3,4,2
(C) 2,1,3,4
(D) 4,1,2,3
Ques 19 : Which method is used to find the number of column in ResultSet?
(A) getNumberOfColumn
(B) getMaxColumn
(C) getColumnCount
(D) getColumns
Ques 20 : ResultSet.CONCUR_UPDATABLE used with the result set is used
to update the rows directly in the database.
(A) False
(B) True
Ques 1 : Which JDBC driver Type(s) is(are) the JDBC-ODBC bridge?
(A) Type 1
(B) Type 2
(C) Type 3
(D) Type 4
Ques 2 : What is sent to the user via HTTP, invoked using the HTTP protocol
on the user's computer, and run on the user's computer as an application?
(A) A Java application
(B) A Java applet
(C) A Java servlet
(D) None of the above is correct.
Ques 3 : Which isolation level prevents dirty read in JDBC, connection class.
(A) TRANSACTION_READ_ COMMITTED
(B) TRANSACTION_UNREAD_ COMMITTED
Ques 4 : Which JDBC driver Type(s) can be used in either applet or servlet
code?
(A) Both Type 1 and Type 2
(B) Both Type 3 and Type 4
(C) Both Type 1 and Type 3
(D) Type 4 only
Ques 5 : Which of the following is true regarding not finding the
java.sql.DriverManager class.
(A) This problem can be caused by running a JDBC applet in a browser that supports
the JDK 1.0.2, such as Netscape Navigator 3.0. The JDK 1.0.2 does not contain the JDBC
API, so the DriverManager class typically isn't found by the Java virtual machine running
(B) Most of the browsers cannot download java.* because of security reasons. Hence
many vendors of all-Java JDBC drivers supply versions of the java.sql.* classes that have
been renamed to jdbc.sql.*, along with a version of their driver that uses these modify
(C) Add import jdbc.sql.* in your applet code instead of java.sql.*, and add the
jdbc.sql.* classes provided by your JDBC driver vendor to your applet's codebase, then
all of the JDBC classes needed by the applet can be downloaded by the browser at run
time,
(D) All of the above
Ques 6 : JDBC-ODBC Bridge is platform independent driver.
(A) False
(B) True
Ques 7 : Which method is used to find the number of column in ResultSet?
(A) getNumberOfColumn
(B) getMaxColumn
(C) getColumnCount
(D) getColumns
Ques 8 : Which JDBC driver Type(s) can you use in a three-tier architecture
and if the Web server and the DBMS are running on the same machine?
(A) Type 1 only
(B) Type 2 only
(C) Both Type 3 and Type 4
(D) All of Type 1, Type 2, Type 3 and Type 4
Ques 9 : Which of the following statements is true regarding the failing of
the class.forName in jdk 1.1.x.
(A) A workaround is to explicitly call the method DriverManager.registerDriver(new
YourDriverClass).
(B) The problem is due to race condition in the class loader.
(C) The race condition prevents the static section of code in the driver class from
executing and registering the driver with the DriverManager.
(D) All the above.
Ques 10 : ResultSet.CONCUR_UPDATABLE used with the result set is used
to update the rows directly in the database.
(A) False
(B) True
Ques 11 : what is jdbc ?
(A) a
(B) b
(C) c
(D) d
Ques 12 : Which of the following methods are needed for loading a
database driver in JDBC?
(A) registerDriver() method
(B) Class.forName()
(C) Both A and B
(D) getConnection()
Ques 13 : Whatâ??s the difference between TYPE_SCROLL_INSENSITIVE ,
and TYPE_SCROLL_SENSITIVE?
(A) Both types of result sets will make changes visible if they are closed and then
reopened.
(B) A result set that is TYPE_SCROLL_INSENSITIVE does not reflect changes made
while it is still open and one that is TYPE_SCROLL_SENSITIVE does.
(C) You will get a scrollable ResultSet object if you specify one of these ResultSet
constants.
(D) A result set that is TYPE_SCROLL_INSENSITIVE makes the result set read only
while one that is TYPE_SCROLL_SENSITIVE does not.
Ques 14 : Where is metadata stored in MySQL?
(A) In the MySQL database mysql
(B) In the MySQL database metadata
(C) In the MySQL database metasql
(D) In the MySQL database mysql
Ques 15 : Which JDBC driver Type(s) can be used in either applet or servlet
code?
(A) Both Type 1 and Type 3
(B) Both Type 1 and Type 2
(C) Both Type 3 and Type 4
(D) Type 4 only
Ques 16 : Which type of JDBC driver is the fastest one?
(A) Type 4
(B) Type 3
(C) Type 2
(D) Type 1
Ques 17 : State true or false :- ResultSet.CONCUR_UPDATABLE used with
the result set is used to update the rows directly in the database.
(A) True
(B) False
Ques 18 : How many JDBC drivers are there ?
(A) 1
(B) 2
(C) 3
(D) 4
Ques 19 : How many JDBC driver types does Sun define?
(A) One
(B) Two
(C) Three
(D) Four
Ques 20 : Which of the following statement is false regarding the use of
setAutoCommit() in JDBC
(A) When a connection is created, it is in auto-commit mode.
(B) If the value is true each individual SQL statement is treated as a transaction and
will be automatically committed right after it is executed.
(C) once auto-commit mode is disabled, no SQL statements will be committed until
you call the method commit explicitly
(D) By default the JDBC call is in auto-commit mode.
Ques 1 : Which type of JDBC driver is the fastest one?
(A) Type-1 driver
(B) Type-2 driver
(C) Type-3 driver
(D) Type-4 driver
Ques 2 : Is JDBC support Named Param?
(A) Yes
(B) No
Ques 3 : By default "auto commit" option is -
(A) true
(B) false
Ques 4 : Which one is correct Driver class name for Type-1 driver?
(A) Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
(B) Class.forName("sun.odbc.jdbc.JdbcOdbcDriver")
(C) Class.forName("sun.jdbc.odbc.OdbcJdbcDriver")
(D) Class.forName("sun.odbc.jdbc.OdbcJdbcDriver")
Ques 5 : Which statement is correct?
(A) ResultSet rs = stmt.selectQuery("SELECT COF_NAME, PRICE FROM COFFEES");
(B) ResultSet rs = stmt.executeSelect("SELECT COF_NAME, PRICE FROM COFFEES");
(C) ResultSet rs = stmt.runQuery("SELECT COF_NAME, PRICE FROM COFFEES");
(D) ResultSet rs = stmt.executeQuery("SELECT COF_NAME, PRICE FROM COFFEES");
Ques 6 : rollback( ) methods belongs to-
(A) Statement
(B) Connection
(C) ResultSet
(D) none of these
Ques 7 : Which driver is suitable when application is accessing multiple
types of databases at the same time?
(A) Type-1 driver
(B) Type-2 driver
(C) Type-3 driver
(D) Type-4 driver
Ques 8 : Which type of JDBC driver is the fastest one?
(A) Type-1 driver
(B) Type-2 driver
(C) Type-3 driver
(D) Type-4 driver
Ques 9 : How do you call the stored procedure in JDBC?
(A) CallableStatement cs = con.prepareCall("{call SHOW_SUPPLIERS}");
(B) CallableStatement cs = con.makeCall("{call SHOW_SUPPLIERS}");
(C) CallableStatement cs = con.preparedCall("{call SHOW_SUPPLIERS}");
(D) CallableStatement cs = con.createCall("{call SHOW_SUPPLIERS}");
Ques 10 : We can get the column names using?
(A) ResultSetColumnData
(B) ResultSetMetaData
(C) ResultSetHeaderData
(D) ResultSetTableData
Ques 11 : Which package we need to import to work with JDBC?
(A) import java.sql.* ;
(B) import javax.sql.* ;
(C) import java.jdbc.sql.* ;
(D) import java.jdbc.* ;
Ques 12 : SELECT, INSERT, DELETE, UPDATE, COMMIT and ROLLBACK comes
under ?
(A) DML
(B) DDL
Ques 13 : Which one the type of RowSet?
(A) Connected
(B) Disconnected
(C) Both A and B
(D) none of these
Ques 14 : The return type of execute(String query) is?
(A) int
(B) ResultSet
(C) boolean
(D) void
Ques 15 : Which interface is responsible for transaction management in
JDBC?
(A) TransactionManagement
(B) Connection
(C) ResultSet
(D) PreparedStatement
Ques 16 : Which is not a Isolation level in JDBC?

(A) TRANSACTION_READ_UNCOMMITTED
(B) TRANSACTION_READ_COMMITTED
(C) TRANSACTION_REPEATABLE_READ
(D) TRANSACTION_NONE_COMMITTED
Ques 17 : "No suitable driver" error message is coming during-
(A) DriverManager.getConnection()
(B) Class.forName();
(C) stmt.executeQuery();
(D) none of these
Ques 18 : RowSet is belong to which package?
(A) java.sql
(B) javax.sql
(C) java.jdbc
(D) javax.jdbc
Ques 19 : RowSet objects are having all the features of ResultSet-
(A) Yes
(B) No
Ques 20 : We can get the Database details using?
(A) DatabaseDetails
(B) DatabaseServerData
(C) DatabaseRawData
(D) DatabaseMetaData
Ques 1 : Which of the following allows non repeatable read in JDBC
Connection?
(A) TRANSACTION_READ_COMMITTED
(B) TRANSACTION_READ_UNCOMMITTED
(C) TRANSACTION_REPEATABLE_READ
(D) TRANSACTION_SERIALIZABLE
Ques 2 : Which of the following statements is true regarding the failing of
the class.forName in jdk 1.1.x.
(A) A workaround is to explicitly call the method DriverManager.registerDriver(new
YourDriverClass).
(B) The problem is due to race condition in the class loader.
(C) The race condition prevents the static section of code in the driver class from
executing and registering the driver with the DriverManager.
(D) All the above.
Ques 3 : How many JDBC driver types does Sun define?
(A) One
(B) Two
(C) Three
(D) Four
Ques 4 : The JDBC-ODBC Bridge supports multiple concurrent open
statements per connection?
(A) False
(B) True
Ques 5 : Whatâ??s the difference between TYPE_SCROLL_INSENSITIVE , and
TYPE_SCROLL_SENSITIVE?
(A) Both types of result sets will make changes visible if they are closed and then
reopened.
(B) A result set that is TYPE_SCROLL_INSENSITIVE does not reflect changes made
while it is still open and one that is TYPE_SCROLL_SENSITIVE does.
(C) You will get a scrollable ResultSet object if you specify one of these ResultSet
constants.
(D) A result set that is TYPE_SCROLL_INSENSITIVE makes the result set read only
while one that is TYPE_SCROLL_SENSITIVE does not.
Ques 6 : Where is metadata stored in MySQL?
(A) In the MySQL database mysql
(B) In the MySQL database metadata
(C) In the MySQL database metasql
(D) In the MySQL database mysql
Ques 7 : Which of the following statements is false as far as different type of
statements is concern in JDBC?
(A) Regular Statement
(B) Interim Statement
(C) Callable Statement
(D) Prepared Statement
Ques 8 : Which of the following is true regarding not finding the
java.sql.DriverManager class.
(A) This problem can be caused by running a JDBC applet in a browser that supports
the JDK 1.0.2, such as Netscape Navigator 3.0. The JDK 1.0.2 does not contain the JDBC
API, so the DriverManager class typically isn't found by the Java virtual machine running
(B) Most of the browsers cannot download java.* because of security reasons. Hence
many vendors of all-Java JDBC drivers supply versions of the java.sql.* classes that have
been renamed to jdbc.sql.*, along with a version of their driver that uses these modify
(C) Add import jdbc.sql.* in your applet code instead of java.sql.*, and add the
jdbc.sql.* classes provided by your JDBC driver vendor to your applet's codebase, then
all of the JDBC classes needed by the applet can be downloaded by the browser at run
time,
(D) All of the above
Ques 9 : Which JDBC driver Type(s) can be used in either applet or servlet
code?
(A) Both Type 1 and Type 3
(B) Both Type 1 and Type 2
(C) Both Type 3 and Type 4
(D) Type 4 only
Ques 10 : Which of the following methods are needed for loading a
database driver in JDBC?
(A) registerDriver() method
(B) Class.forName()
(C) Both A and B
(D) getConnection()
Ques 11 : Which of the following statement is false regarding the use of
setAutoCommit() in JDBC
(A) When a connection is created, it is in auto-commit mode.
(B) If the value is true each individual SQL statement is treated as a transaction and
will be automatically committed right after it is executed.
(C) once auto-commit mode is disabled, no SQL statements will be committed until
you call the method commit explicitly
(D) By default the JDBC call is in auto-commit mode.
Ques 12 : ________ is an open source DBMS product that runs on UNIX, Linux
and Windows.
(A) JSP/SQL
(B) MySQL
(C) JDBC/SQL
(D) Sun ACCESS
Ques 13 : Which of the following is false as far as type 4 driver is concern?
(A) Type 4 driver is "native protocol, pure java" driver
(B) Type 4 drivers can not be used with Netscape
(C) Type 4 drivers are 100% Java compatible
(D) Type 4 drivers uses Socket class to connect to the database
Ques 14 : Which of the following is false regarding the Type 3 JDBC driver
(A) A Type 3 driver is a JDBC-Net pure Java driver
(B) This translates JDBC calls into a database -dependent net protocol.
(C) Vendors of database middleware products can implement this type of driver into
their products to provide interoperability with the greatest number of database servers.
(D) a,b
Ques 15 : What is sent to the user via HTTP, invoked using the HTTP
protocol on the user's computer, and run on the user's computer as an
application?
(A) A Java application
(B) A Java applet
(C) A Java servlet
(D) None of the above is correct.
Ques 16 : To execute a stored procedure â??totalStockâ?? in a database
server, which of the following code snippet is used?
(A) CallableStatement clbstmnt = con.prepareCall("{call
totalStock}");cs.executeQuery();
(B) Statement stmt = connection.createStatement();stmt.execute("totalStock()");
(C) StoreProcedureStatement spstmt =
connection.createStoreProcedure("totalStock()");spstmt.executeQuery();
(D) PrepareStatement pstmt =
connection.prepareStatement("totalStock()");pstmt.execute();
Ques 17 : What MySQL property is used to create a surrogate key in
MySQL?
(A) UNIQUE
(B) AUTO_INCREMENT
(C) SEQUENCE
(D) None of the above -- Surrogate keys are not implemented in MySQL.
Ques 18 : State true or false :- ResultSet.CONCUR_UPDATABLE used with
the result set is used to update the rows directly in the database.
(A) True
(B) False
Ques 19 : Which driver is efficient and always preferable for using JDBC
applications?
(A) Type-4
(B) Type-1
(C) Type-2
(D) Type-3
Ques 20 : Which JDBC driver Type(s) can you use in a three-tier architecture
and if the Web server and the DBMS are running on the same machine?
(A) Type 1 only
(B) Type 2 only
(C) Both Type 3 and Type 4
(D) All of Type 1, Type 2, Type 3 and Type 4

You might also like