Oracle Drivers:  Thin and OCI....what are they.

(adapted from http://tns.sdsu.edu/~diebel/jdbc/jdbcoci2.htm#422133)

JDBC is a set of classes and interfaces written in Java to allow other Java programs to send SQL statements to a relational database management system.

Oracle provides two categories of JDBC drivers:
 
 

Oracle's JDBC Thin driver is a Type 4 driver that uses Java sockets to connect directly to Oracle. It provides its own implementation of a TCP/IP version of Oracle's SQL*Net. Because it is 100% Java, this driver is platform independent.

The Oracle Call Interface (OCI) is an application programming interface to Oracle databases. It consists of a library of C language routines to allow C programs (or programs written in other third generation languages) to send SQL statements to the database and interact with it in other ways.

Oracle's JDBC OCI drivers are Type 2 JDBC drivers. They provide an implementation of the JDBC interfaces that uses the OCI to interact with an Oracle database. You must use a JDBC OCI driver appropriate to your Oracle client installation. OCI is a client side program.
 
 

Either of these client versions can access Oracle7 or Oracle8 servers.

The JDBC OCI drivers allow you to call the OCI directly from Java, thereby providing a high degree of compatibility with a specific Version of Oracle. Because they use native methods, they are platform specific. The available versions are:
 
 

Because Java has undergone significant changes over its brief life, you must use a version that matches your Java Development Kit.
 
  The Java classes for JDK 1.0.2 contain the JDBC 1.22 classes from Javasoft. The Java classes for JDK 1.1.1 do not contain the JDBC classes, because those are a standard part of JDK 1.1.1.

Oracle provides three distribution versions, by platform:
 
 

Each of these contains all of the driver versions appropriate for that platform.


Configuration

The JDBC Thin driver is appropriate for use by Java applets that can be downloaded into a web browser. It is entirely self contained, requiring no Oracle-specific software or files on the client side. It does, however, need to open a Java socket. It cannot run successfully in a browser that does not allow that operation.

The Oracle JDBC OCI drivers are not appropriate for Java applets, because they use a C library that is platform specific and not downloadable into a Web browser.

Java applications and Java code running in the Java cartridge must explicitly load a JDBC OCI driver before using the JDBC entrypoints. See Using Oracle's JDBC Drivers for details of how to do this.