A Java program that uses the JDBC API loads the specified driver for a particular DBMS before it actually connects to a database. The JDBC DriverManager class then sends all JDBC API calls to the loaded driver.
The four types of JDBC drivers are:
1. Type 1: JDBC-ODBC Bridge Driver
Translates JDBC API calls into Microsoft Open Database Connectivity (ODBC) calls that are then passed to the ODBC driver. The ODBC binary code must be loaded on every client computer that uses this type of driver.
2. Type 2: JDBC-Native API
Converts JDBC API calls into DBMS-specific client API calls. Like the bridge driver, this type of driver requires that some binary code be loaded on each client computer.
3. Type 3: JDBC-Net pure Java
Sends JDBC API calls to a middle-tier net server that translates the calls into the DBMS-specific network protocol. The translated calls are then sent to a particular DBMS.
4. Type 4: 100% pure Java
Converts JDBC API calls directly into the DBMS-specific network protocol without a middle tier. This allows the client applications to connect directly to the database server.
JDBC stands for
“Java Database Connectivity” JDBC is an API defined in the
javax.sql packages for connecting an arbitrary database to a Java program. JDBC is a set of classes and interfaces written in the Java programming language.