Types of JDBC drivers
by, 11-11-2011 at 06:44 PM (1215 Views)
There are 4 different types of JDBC drivers that can be used in Java database applications. Which driver to use, depends on the requirements and available resources. I will briefly talk about each driver.
Type 1 is JDBC-OBC bridge driver. It is pure Java and is include in java.sql.*. The client needs ODBC driver manager and ODBC driver for data source. It is ideal in situations, when ODBC driver is available for the database and is already installed on the client machine.
Type 2 is Native code driver. It implements native JDBC interfaces using language functions in the DBMS productís API. Type 2 drivers need platform specific library, so client and server both may run on same host. Type 2 drivers offer better performance than Type 1 drivers.
Type 3 drivers are pure Java drivers and they use middleware network protocol. They need DBMS server to implement the standard protocol to be middleware specific. The advantage is that there is no nee for any vendor database library to be present on client machines. Interesting thing is, there is no JDBC standard network protocol yet.
Type 4 drivers are pure Java drivers and they use vendor specific network protocol. These use DBMS specific network protocol (Oracle SQL Net, etc).
For the beginners, Type 1 drivers are suitable. Users simply have to make a DSN and start interacting with the database.