Java Reference
In-Depth Information
 
Types 3 and 4 are typically used by vendors of middleware or databases.
A more detailed description of the different types of drivers follows.
JDBC driver types
The four structurally different types of JDBC drivers are as follows:
 
Type 1: JDBC-ODBC bridge plus ODBC driver
 
Type 2: Native-API partly Java driver
 
Type 3:JDBC-Net pure Java driver
 
Type 4: Native-protocol pure Java driver
These types are discussed in the following sections.
Type 1: JDBC-ODBC bridge plus ODBC driver
The JDBC-ODBC bridge product provides JDBC access via ODBC drivers. ODBC
(Open Database Connectivity) predates JDBC and is widely used to connect to
databases in a non-Java environment. ODBC is probably the most widely available
programming interface for accessing relational databases.
The main advantages of the JDBC-ODBC bridge are as follows:
 
It offers the ability to connect to almost all databases on almost all platforms.
 
It may be the only way to gain access to some low-end desktop databases and applications.
Its primary disadvantages are as follows:
 
ODBC drivers must also be loaded on the target machine.
 
Translation between JDBC and ODBC affects performance.
Type 2: Native-API partly Java driver
Type 2 drivers use a native API to communicate with a database system. Java native
methods are used to invoke the API functions that perform database operations.
A big advantage of Type 2 drivers is that they are generally faster than Type 1 drivers.
The primary disadvantages of Type 2 drivers are as follows:
 
Type 2 drivers require native code on the target machine.
 
The Java Native Interface on which they depend is not consistently implemented amongdifferent
vendors of Java virtual machines.
Type 3:JDBC-Net pure Java driver
Search WWH ::




Custom Search