Four Kinds of JDBC Driver

From SwinBrain

The four kinds of drivers

The JDBC driver provides the ability to communicate with a DBMS for Java programs. There are four types of JDBC driver. The different types of driver are distinguished by their implementation.

  • Type 1 JDBC-ODBC Bridge: This type of driver connects to the DBMS via ODBC.
  • Type 2: JDBC-Native Invoke: Rather than going via ODBC this driver connects using a native library. The JDBC driver is used to pass calls onto this native interface.
  • Type 3: JDBC-Middleware: Rather than connecting via a native client library, this driver type connects via a middleware server. The middleware server translates the calls to different DBMS protocols.
  • Type 4: JDBC-DBMS: A direct, pure Java, JDBC to DBMS driver. The driver connects directly to the DBMS.

You should aim to use a Type 4 driver if one is available. This driver avoids the additional translations required by the other driver types. The following list outlines the different translations from the JDBC call to something the DBMS can understand, the DBMS protocol.

  • Type 1: Requires calls to be translated from JDBC to ODBC, and then from ODBC to the DBMS protocol.
  • Type 2: The Java calls to the JDBC interface must be marshaled to native calls passed to the native client library. The client library then maps these from the native call to the DBMS protocol.
  • Type 3: The JDBC calls are mapped to the middleware protocol and sent to the middleware server, which in turn maps the call from the middleware protocol to the DBMS protocol.
  • Type 4: The JDBC calls are mapped directly to the DBMS protocol.

Links

External links on the JDBC driver types:

[edit]Links: Topic Brains
Return to Swin Brain