Oracle8 JDBC Drivers Section 2. Common Features of Oracle JDBC Drivers The server-side and...

16
Oracle8 JDBC Drivers Oracle8 JDBC Drivers Section 2 Section 2

Transcript of Oracle8 JDBC Drivers Section 2. Common Features of Oracle JDBC Drivers The server-side and...

Page 1: 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.

Oracle8 JDBC DriversOracle8 JDBC Drivers

Section 2Section 2

Page 2: 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.

Common Features of Oracle Common Features of Oracle JDBC DriversJDBC Drivers

The server-side and client-side Oracle JDBC The server-side and client-side Oracle JDBC drivers provide the same basic functionality. drivers provide the same basic functionality. They all support the following standards and They all support the following standards and features: features: Either JDK 1.2.x / JDBC 2.0 or JDK 1.1.x / Either JDK 1.2.x / JDBC 2.0 or JDK 1.1.x / JDBC 1.22 (with Oracle extensions for JDBC JDBC 1.22 (with Oracle extensions for JDBC 2.0 functionality). These two implementations 2.0 functionality). These two implementations use different sets of class files. use different sets of class files.

Page 3: 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.

ContinuedContinued

The same syntax and APIs The same syntax and APIs The same Oracle extensions The same Oracle extensions Full support for multi-threaded applications Full support for multi-threaded applications

Generally speaking, the only differences Generally speaking, the only differences between the drivers are in how they connect between the drivers are in how they connect to the database and how they transferto the database and how they transferdata. data.

Page 4: 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.

Supported JDK & JDBC Supported JDK & JDBC VersionsVersions

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.

Page 5: 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.

Oracle8 JDBC Client-side Oracle8 JDBC Client-side DriversDrivers

Oracle provides two categories of JDBC Oracle provides two categories of JDBC Client-side drivers:Client-side drivers:

JDBC Thin for Java applets and applicationsJDBC Thin for Java applets and applicationsJDBC OCI for Java applicationsJDBC OCI for Java applications

Page 6: 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.

JDBC ThinJDBC Thin Oracle’s JDBC Thin driver is a Type 4 driver that Oracle’s JDBC Thin driver is a Type 4 driver that

uses Java sockets to connect directly to Oracle. It uses Java sockets to connect directly to Oracle. It provides its own implementation of a TCP/IP provides its own implementation of a TCP/IP version of Oracle’s Net8.version of Oracle’s Net8.

It connects to any Oracle database of version It connects to any Oracle database of version 7.2.3 or higher.7.2.3 or higher.

This driver is written entirely in Java, so it is This driver is written entirely in Java, so it is platform-independent. It doesn’t require Oracle platform-independent. It doesn’t require Oracle software in the client sidesoftware in the client side

Page 7: 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.

ContinuedContinued

The driver supports only TCP/IP protocol The driver supports only TCP/IP protocol and requires a TNS listener on the TCP/IP and requires a TNS listener on the TCP/IP sockets from the database server. 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

Page 8: 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.

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.

Page 9: 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.

JDBC OCIJDBC OCI Oracle’s JDBC driver is Type2 JDBC driver. It uses Oracle’s JDBC driver is Type2 JDBC driver. It uses

the OCI (Oracle Call Interface) to interact with an the OCI (Oracle Call Interface) to interact with an Oracle database and requires an Oracle client Oracle database and requires an Oracle client installationinstallation

It is platform-specific. The supported platforms are:It is platform-specific. The supported platforms are: --- Solaris: version 2.5 and above--- Solaris: version 2.5 and above --- Windows: 95 and NT 3.51 and above--- Windows: 95 and NT 3.51 and above The OCI drivers provide the highest compatibility The OCI drivers provide the highest compatibility

with the different Oracle 7, 8, and 8i versions. They with the different Oracle 7, 8, and 8i versions. They also support all installed Net8 adapters.also support all installed Net8 adapters.

Page 10: 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.

ContinuedContinued

OCI drivers, because they are platform OCI drivers, because they are platform

specific, are not suitable for use in applets specific, are not suitable for use in applets intended to be downloaded into browsers intended to be downloaded into browsers running on unknown platforms. They are, running on unknown platforms. They are, however, excellent choices for Java however, excellent choices for Java application or Java middle tiers like the application or Java middle tiers like the Oracle Web Application Server 3.0 Java Oracle Web Application Server 3.0 Java Cartridge.Cartridge.

Page 11: 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.

ContinuedContinued

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

Page 12: 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.

Oracle8 JDBC Server DriverOracle8 JDBC Server Driver

Oracle's JDBC Server driver is for server-side 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.

Page 13: 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.

ContinuedContinued 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.

Page 14: 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.

Driver-Database ArchitectureDriver-Database Architecture

Page 15: 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.

Choosing the Appropriate DriverChoosing 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.

Page 16: 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.

If you desire maximum portability, then choose If you desire maximum portability, then choose the JDBC Thin driver. You can connect to an the JDBC Thin driver. You can connect to an Oracle8 data server from either an application or Oracle8 data server from either an application or an applet using the JDBC Thin driver.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.