Java Database Connectivity Question and Answers

13. How many JDBC Drivers are there?
  There are four types of JDBC drivers.
  • JDBC – ODBC Bridge Driver (Type – 1 driver)
  • Native API Partly Java Driver (Type – 2 driver)
  • Net Protocol Pure Java Driver (Type – 3 driver)
  • Native Protocol Pure Java Driver (Type – 4 driver)
 
Your Name Your Email-ID
Your Answer
14. What is the difference between JDBC and ODBC?
 
  • ODBC is for Microsoft and JDBC is for Java applications.
  • ODBC can't be directly used with Java because it uses a C interface.
  • ODBC makes use of pointers which have been removed totally from Java.
  • ODBC mixes simple and advanced features together and has complex options for simple queries. But JDBC is designed to keep things simple while allowing advanced capabilities when required.
  • ODBC requires manual installation of the ODBC driver manager and driver on all client machines. JDBC drivers are written in Java and JDBC code is automatically installable, secure, and portable on all platforms.
  • JDBC API is a natural Java interface and is built on ODBC. JDBC retains some of the basic features of ODBC.
 
Your Name Your Email-ID
Your Answer
15. What packages are used in JDBC?
  There are 8 packages:
  • java.sql.Driver
  • Connection
  • Statement
  • PreparedStatement
  • CallableStatement
  • ResultSet
  • ResultSetMetaData
  • DatabaseMetaData
 
Your Name Your Email-ID
Your Answer
16. What type of driver did you use in project?
 
  • JDBC – ODBC Bridge driver (is a driver that uses native(C language) libraries and makes calls to an existing ODBC driver to access a database engine).
 
Your Name Your Email-ID
Your Answer
1234 Page 4 of 4