JDBC Driver Types

Oracle, as mentioned in the last chapter, provides us with two JDBC drivers—an OCI driver and a pure-Java thin driver. These are, respectively, type 2 and type 4 drivers. There are, more generally, four types of drivers available.

Type 1: Bridge driver. The purpose of a JDBC driver is to connect Java code to a database. In many cases, the most expedient way of doing this is to connect Java to an existing driver that uses another comparable technology, such as Microsoft's Open Database Connectivity (ODBC). In fact, the most common driver of this type is a JDBC-ODBC bridge, which maps JDBC calls to ODBC calls and allows a Java program to use databases supporting ODBC.

Type 2: Native API driver. This type of driver, of which the ...

Get Java™ Oracle® Database Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.