The document contains questions about JDBC driver types, SQL statements, and basic JDBC concepts. It covers that:
- Type 2 drivers provide JDBC access via ODBC, Type 3 drivers convert JDBC calls directly to the database protocol.
- PreparedStatements can execute parameterized queries.
- The java.sql package contains classes for connecting to databases and processing query results.
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 ratings0% found this document useful (0 votes)
189 views3 pages
JDBC 1
The document contains questions about JDBC driver types, SQL statements, and basic JDBC concepts. It covers that:
- Type 2 drivers provide JDBC access via ODBC, Type 3 drivers convert JDBC calls directly to the database protocol.
- PreparedStatements can execute parameterized queries.
- The java.sql package contains classes for connecting to databases and processing query results.
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/ 3
1. Which packages contain the JDBC classes?
a) java.jdbc and javax.jdbc
b) java.jdbc and java.jdbc.sql c) java.sql and javax.sql d) java.rdb and javax.rdb 2. Which type of driver provides JDBC access via one or more ODBC drivers? A) Type 1 driver B) Type 2 driver C) Type 3 driver D) Type 4 driver 3. Which type of driver converts JDBC calls into the network protocol used by the database management system directly? A) Type 1 driver B) Type 2 driver C) Type 3 driver D) Type 4 driver 4. JDBC stands for: A) Java Database Connectivity B) Java Database Components C) Java Database Control D) None of the above is correct. 5. ________ is an open source DBMS product that runs on UNIX, Linux and Windows. A) MySQL B) JSP/SQL C) JDBC/SQL D) Sun ACCESS 6. Which JDBC driver Type(s) can be used in either applet or servlet code? A. Both Type 1 and Type 2 B. Both Type 1 and Type 3 C. Both Type 3 and Type 4 D. Type 4 only 7. 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() 10. Which of the following statements is false as far as different type of statements is concern in JDBC? a) Regular Statement b) Prepared Statement c) Callable Statement d) Interim Statement 11. The JDBC-ODBC Bridge supports multiple concurrent open statements per connection? a) True b) False
Which type of Statement can execute parameterized queries?
a) PreparedStatement b) ParameterizedStatement c) ParameterizedStatement and CallableStatement d) All kinds of Statements 12. Which type of Statement can execute parameterized queries?
a) PreparedStatement c) ParameterizedStatement and CallableStatement 13. How many JDBC driver types does Sun define? a) one b) two c) three d) four
b) ParameterizedStatement d) All kinds of Statements
14. What is JDBC?
a) java compiler b) Java API c) Java interpreter d) Both A and B 15. JDBC is a ..................... interface, which means that it is used to invoke SQL commands directly A) low-level B) middle-level C) higher-level D) user 16. Kind of driver converts JDBC calls on the client API for Oracle, Sybase, Informix, DB2, or other DBMS is known as A) JDBC-Net pure Java driver B) JDBC-ODBC Bridge plus ODBC driver C) Native-API partly-Java driver D) Both A and B
1. A Java program cannot directly communicate with an ODBC driver
because ....... A) ODBC written in C language B) ODBC written in C# language C) ODBC written in C++ language D) ODBC written in Basic language 2.The JDBC-ODBC Bridge driver translates the JDBC API to the ODBC API and used with ....... A) JDBC drivers B) ODBC drivers C) Both A and B D) None of the above 3. The ............................. package contains classes that help in connecting to a database, sending SQL statements to the database, and processing the query results. A) connection.sql B) db.sql C) pkg.sql D) java.sql 4. The ................................ method executes a simple query and returns a single Result Set object. A) executeUpdate() B) executeQuery() C) execute() D) noexecute() 5. The ......................... method executes an SQL statement that may return multipleresults. A) executeUpdate() B) executeQuery() C) execute() D) noexecute() 6. The ........................ object allows you to execute parametrized queries. A) ResultSet B) Parametrized C) PreparedStatement D) Condition 7. The .................. object provides you with methods to access data from the table. A) ResultSet B) Parametrized C) TableStatement D) Condition 8. The parameters of the PreparedStatement object are ...................... when the user clicks on the Query button. A) initialized B) started C) paused D) stopped 9. The ...................... method sets the query parameters of the PreparedStatement Object. A) putString() B) insertString()
C) setString()
D) setToString()
10. Connection object can be initialized using the ............................
method of the Driver Manager class. A) putConnection() B) setConnection() C) Connection() D) getConnetion()