In this section, you ll learn about the various Oracle JDBC drivers that enable the JDBC statements in a Java program to access an Oracle database. It is through a JDBC driver that your JDBC statements access a database. There are four Oracle JDBC drivers:
Thin driver
OCI driver
Server-side internal driver
Server-side Thin driver
The following sections describe each of these drivers in detail.
The Thin driver has the smallest footprint of all the drivers, meaning that it requires the least amount of system resources to run, and it is written entirely in Java. If you are writing a Java applet, you should use the Thin driver. The Thin driver may also be used in stand-alone Java applications and may be used to access all versions of the Oracle database. The Thin driver only works with TCP/IP and requires that Oracle Net be up and running. For details on Oracle Net, speak with your DBA or consult the Oracle Net documentation.
Note | You don t have to install anything on the client computer to use the Thin driver and therefore you can use it for applets. |
The OCI driver requires more resources than the Thin driver, but generally has better performance. The OCI driver is suitable for programs deployed on the middle tier ”a web server, for example.
Note | The OCI driver requires that you install it on the client computer and is therefore not suitable for applets. |
The OCI driver has a number of performance enhancing features, including the ability to pool database connections and prefetch rows from the database. The OCI driver works with all versions of the database and all of the supported Oracle Net protocols.
The server-side internal driver provides direct access to the database, and is used by the Oracle JVM to communicate with that database The Oracle JVM is a Java Virtual Machine that is integrated with the database ”you can load a Java class into the database, then publish and run methods contained in that class using the Oracle JVM.
The server-side Thin driver is also used by the Oracle JVM, and provides access to remote databases. Like the Thin driver, this driver is also written entirely in Java.