Chapter 5. Internal Database Connections

As you probably already know, the Oracle8i database engine includes an embedded JVM known as the JServer. In this chapter, we’ll explore the issues that are specific to using JDBC to connect objects that reside in Oracle8i’s internal JVM to a database. I say a database rather than the database, because JDBC can be used to connect internally to the local database or externally to another database. As in the other connection chapters, we’ll cover the types of Oracle drivers available. We’ll also go over lots of examples to show each type of driver in use and talk about the types of Java objects that the internal JVM supports. Let’s begin our discussion by looking at the Oracle drivers that are available for an internal client.

Server-Side Driver Types

To support the use of JDBC by Java code running within JServer, Oracle supplies the following two server-side JDBC drivers:

Server-side internal driver

The server-side internal driver is used by stored procedures, EJB, or any other type of object that resides in Oracle8i’s internal JVM to establish a direct connection internally to the local database. The server-side internal driver runs in the same memory space as the database kernel, the SQL engine, and the JServer JVM. Any Java object that uses this driver to connect to the database has the same default session as any PL/SQL stored procedure or SQL object. This driver has all the same APIs as the client-side drivers.

Server-side Thin driver

Get Java Programming with Oracle JDBC 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.