Sun Java Solaris Communities My SDN Account Join SDN
 
Quizzes

JDBC 2.0 Fundamentals Quiz

 

Quizzes Index

2.0 Fundamentals Quiz

Duke

This JDBC 2.0 Fundamentals Quiz offers a way to test the knowledge you learned about the JDBC 2.0 API from the JDBC 2.0 Fundamentals Short Course. For additional help on JDBC, be sure to check out the JDBC FAQ at jGuru.

1. If you need to use a stored procedure with output parameters, which of the following statement type should be used to call the procedure?
 A. Statement
 B. PreparedStatement
 C. CallableStatement


2. Which of the following will not cause a JDBC driver to be loaded and registered with the DriverManager?
 A. Class.forName(driverString);
 B. new DriverClass();
 C. Include driver name in jdbc.drivers system property
 D. None of the above


3. From which object do you ask for DatabaseMetaData?
 A. Connection
 B. ResultSet
 C. DriverManager
 D. Driver


4. SQLWarnings from multiple Statement method calls (like executeUpdate) will build up until you ask for them all with getWarnings and getNextWarning.
 A. True
 B. False


5. If one intends to work with a ResultSet, which of these PreparedStatement methods will not work?
 A. execute()
 B. executeQuery()
 C. executeUpdate()


6. Can a ResultSet be reliably returned from a method that creates a Statement and executes a query?
 A. Yes
 B. No


7. How can I use JDBC to create a database?
 A. Include create=true at end of JDBC URL
 B. Execute "CREATE DATABASE jGuru" SQL statement
 C. Execute "STRSQL" and "CREATE COLLECTION jGuru" SQL statements
 D. Database creation is DBMS specific


8. Which character is used to represent an input parameter in a CallableStatement?
 A. %
 B. *
 C. ?
 D. #


9. Which one of the following will not get the data from the first column of ResultSet rs, returned from executing the following SQL statement: SELECT name, rank, serialNo FROM employee.
 A. rs.getString(0);
 B. rs.getString("name");
 C. rs.getString(1);


10. Which of the following can you do with a JDBC 2.0 database driver that you cannot with a JDBC 1.x driver?
 A. Batch multiple statements, to be sent to the database together
 B. Scroll through result sets bi-directionally
 C. Work with SQL3 data types directly
 D. All of the above


11. Which class contains the transaction control methods setAutoCommit, commit, and rollback?
 A. Connection
 B. Statement
 C. ResultSet