Free Guides

Language Tutorials

Sun Articles

Types of JDBC Drivers - A Solution For Any Java Project

If you spend a lot of time dealing with that legacy code and for no reason doesn't it take advantage of modern methodologies and libraries, you should have taken over Java projects that contain hundreds of thousands of lines of code and not a single third-party jar other than a JDBC driver! Probably the most common example of this is the implementation of the data access layer.

But first, try to discover more about JDBC drivers. All in all, JDBC technology drivers fit into one of four categories, discripted below.

A JDBC-ODBC bridge. It provides JDBC API access via one or more ODBC drivers. Some ODBC native code and sometimes native database client code must be loaded on each client machine that uses this type of driver. This kind of driver is mostly appropriate when automatic installation and downloading of a Java technology application is not required.

A native-API partly Java technology-enabled driver mainly converts JDBC calls into calls on the client API for Oracle, Sybase, DB2 or any other DBMS. Just like the bridge driver, this type of driver requires that some binary code be loaded on each client machine.

A net-protocol fully Java technology-enabled driver is implemented to translate JDBC API calls into a DBMS-independent net protocol. Then it is translated to a DBMS protocol by a server. This net server middleware connects all of its Java technology-based clients to many different databases. In general, this driver is the most flexible JDBC API alternative.

And, finally, a native-protocol fully Java technology-enabled driver converts JDBC technology calls into the network protocol used by DBMSs directly. This strategy allows a direct call from the client machine to the DBMS server and is a practical way out for Intranet access. Since many of these protocols are proprietary the database, vendors themselves can abd will be the primary source for this type of driver.