Java.sql Package in JAVA

Leave a Comment


  1. JDBC helps the client to store and retrieve the data to the data to the databases.
  2. JDBC allows the client to update the databases.

Following are the components that are used for establishing the connection with the database using JDBC.

  1. JDBC API
  2. JDBC Driver manager
  3. JDBC-ODBC bridge

The JDBC API classes are supported by the java package java.sql. Hence we must import java.sql.* in our program.

We have to use following statement for referring the JDBC-ODBC Bridge.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
There is a JDBC Driver Manager which connects your java application or servlet to the JDBC driver. We can try to connect our Java program to MS Access database with JDBC-ODBC Bridge using the Driver Manager.getConnection() method, in which the first parameter is passed as jdbc:odbc:your_database_name. The JDBC-ODBC driver helps to translate the JDBC function calls into the ODBC function calls. The JDBC for any database can be implemented only when the ODBC driver is available. Note that JDBC-ODBC bridge is implemented in sun.jdbc.odbc.

0 comments:

Post a Comment