Oracle8 JDBC Drivers

Download Report

Transcript Oracle8 JDBC Drivers

Oracle8 JDBC Drivers
Section 2
Common Features of Oracle
JDBC Drivers
The server-side and client-side Oracle JDBC
drivers provide the same basic functionality.
They all support the following standards and
features:
Either JDK 1.2.x / JDBC 2.0 or JDK 1.1.x /
JDBC 1.22 (with Oracle extensions for JDBC
2.0 functionality). These two implementations
use different sets of class files.
Continued
The
same syntax and APIs
The same Oracle extensions
Full support for multi-threaded applications
Generally speaking, the only differences
between the drivers are in how they connect to
the database and how they transfer
data.
Supported JDK & JDBC
Versions

Oracle's JDBC drivers, release 8.1.5,
support the JDK versions 1.0.2 and 1.1.x.
They also comply with JDBC version 1.2.2
and, in addition, implement most of the
features of JDBC version 2.0.
Oracle8 JDBC Client-side
Drivers
Oracle provides two categories of JDBC
Client-side drivers:
JDBC
Thin for Java applets and applications
JDBC OCI for Java applications
JDBC Thin
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 Net8.
 It connects to any Oracle database of
version 7.2.3 or higher.
 This driver is written entirely in Java, so it
is platform-independent. It doesn’t require
Oracle software in the client side

Continued
The driver supports only TCP/IP protocol
and requires a TNS listener on the TCP/IP
sockets from the database server.
 The JDBC Thin driver does not require
Oracle software on the client side; it can be
downloaded into a browser simultaneously
with the Java applet being run. From the
client (usually a browser), you select a URL
from an HTML page that contains a Java
applet tag. The web server downloads the

Java applet and the JDBC Thin driver to the
client. The JDBC Thin driver then establishes
a direct connection to the database server
using Java Sockets. However, firewall issues
limited its use in applets for general
distribution via the World Wide Web.
JDBC OCI
Oracle’s JDBC driver is Type2 JDBC driver. It
uses the OCI (Oracle Call Interface) to interact
with an Oracle database and requires an Oracle
client installation
 It is platform-specific. The supported platforms
are:
--- Solaris: version 2.5 and above
--- Windows: 95 and NT 3.51 and above
 The OCI drivers provide the highest compatibility
with the different Oracle 7, 8, and 8i versions.
They also support all installed Net8 adapters.

Continued

OCI drivers, because they are platform
specific, are not suitable for use in applets
intended to be downloaded into browsers
running on unknown platforms. They are,
however, excellent choices for Java
application or Java middle tiers like the
Oracle Web Application Server 3.0 Java
Cartridge.
Continued

You can use the JDBC OCI driver in these
configurations:
--- with a Java application running on a
client machine in a two-tier configuration
--- with a Java application running on a
middle tier in a three-tier configuration
---with a Java servlet running on a middle
tier in a three-tier configuration
Oracle8 JDBC Server Driver

Oracle's JDBC Server driver is for serverside use only. The Server driver provides
server-side JDBC support for any Java
program used in the database, Java stored
procedure, Enterprise Java Beans (EJB) and
for communication with SQL and PL/SQL
programs. The Server driver is fully
consistent with, and supports the same
features and extensions as the client-side
drivers.
Continued

The JDBC Server driver allows Java programs that
use the Oracle 8.1.5 Java Virtual Machine (VM) and
run inside the database to communicate with the
SQL engine. The Server driver, the Java VM, the
database, the C library, and the SQL engine all run
within the same address space. There are no network
round-trips involved. The programs access the SQL
engine by using function calls.
Driver-Database Architecture
Choosing the Appropriate Driver
Four main considerations that you must bear
in mind when choosing which JDBC driver
to use for your application or applet are:
 If you are writing an applet, you must use
the JDBC Thin driver. JDBC OCI-based
driver classes cannot be downloaded to a
Web browser, because they call native (C
language) methods.
If you desire maximum portability, then
choose the JDBC Thin driver. You can
connect to an Oracle8 data server from
either an application or an applet using the
JDBC Thin driver.
 If you are writing an application and need
maximum performance, then choose the
JDBC OCI driver.
 If you are running in the Oracle database
server using the Oracle 8.1.5 Java VM, then
choose the JDBC Server driver.
