JDBC drivers enable a Java program to communicate with a database system. On one side, the driver implements the JDBC API, enabling a Java program to use classes contained in the java.sql package to communicate with it. On the other side, the driver calls methods contained in the API for a DBMS. Some dirvers do so by invoking calls in an intermediate API, called ODBC (Open DataBase Connectivity); in other cases, vendors have implemented the JBDC in their products, and the calls are passed directly by the driver from the Java client to the DBMS.
In order to write and run a Java program that connects to a database, the programmer must confirm that an appropriate driver is available or obtain and install one, if it is not. Normally, the driver is installed on the same machine as the Web server.
There are four types of JDBC drivers:
- Type 1: JDBC:ODBC bridge. JDBC calls translated into ODBC calls which are then sent to the ODBC interface implemented in the DBMS. A JDBC-ODBC bridge is included in the JDK.
- Type 2: Java-to-native API. Java code implements JDBC interface and calls DBMS's native methods in C, C++, etc.
- Type 3: net protocol all-Java driver. Driver functions as a second-tier server, using Java socket connections from client and translating calls to native network API for given DBMS and connecting to that system.
- Type 4: native protocol all-Java driver. Client uses Java socket tp connect directly to the DBMS and to make calls to JDBC interface supported by the DBMS.
http://java.sun.com/products/jdbc/industry.html drivers
http://developer.java.sun.com/developer/Books/JDBCTutorial/index.html
http://java.sun.com/docs/books/tutorial/jdbc/basics/index.html
http://java.sun.com/docs/books/tutorial/jdbc/index.html
http://java.sun.com/docs/books/tutorial/jdbc/index.html