WebObjects 5: How to Use Oracle JDBC drivers

This document describes the Oracle JDBC drivers and how to use them with WebObjects 5.

Applicable products

Types of JDBC Drivers

Only the thin JDBC driver has been qualified for Mac OS X, Windows 2000, and Solaris.

WebObjects 5.0 and WebObjects 5.1

WebObjects 5.2

WebObjects 5.3

See technical document 72598 "WebObjects Compatibility Guide" for all other database JDBC support.

Where to Obtain Oracle JDBC Drivers

The Oracle JDBC drivers are available from Oracle's website (http://otn.oracle.com/software/content.html). You need an Oracle technet account to download the drivers. (You can set up an account on Oracle's website for free.)

Windows 2000

Download the thin JDBC drivers for both JDK 1.3.x and JDK 1.1.x.

The files are:

Mac OS X

Mac OS X 10.0.x

Mac OS X 10.2

Please note that you should use the Oracle 9i thin JDBC driver when accessing the Oracle 9i database to avoid the possible ORA-00600 error.

Mac OS X 10.4

Follow the instructions from the Oracle download site to download the Oracle 10 g thin JDBC driver for JDK 1.4 (ojdbc14.jar).

Solaris 2.8

Where to Install the Oracle JDBC drivers

This section contains the proper location for the Oracle JDBC drivers. The applicable platform is listed in bold.

  1. The JDBC driver (classes 12.zip) must be installed where the Java VM can find it. The simplest procedure is to add the JDBC driver (zip file) to the Java VM's "extensions".

    (All Platforms)

    Examples

    Windows 2000
    The Java VM "extension" directory is generally C:\\jdk1.3.x\\jre\\lib\\ext\\ . However, the exact directory depends on where JDK 1.3.x is installed on your computer.

    Mac OS X - WebObjects 5.1 to 5.3
    Place the JDBC file in /Library/Java/Extensions

    Mac OS X - WebObjects 5.0 only
    Place the JDBC file in /Library/Java/Home/lib/ext/

    Solaris
    Place the JDBC file in /usr/java/jre/lib/ext

  2. Install the JDK 1.1 driver in $NEXT_ROOT/Library/Java and modify the JavaConfig.plist file accordingly.

    Windows 2000 only

    When doing development on Windows 2000, the situation is somewhat more complicated. The WebObjects 5 runtime uses a Java 2 VM and requires a JDK 1.3.x compatible JDBC driver just like Mac OS X and other platforms. However, EOModeler uses the Java Bridge, which only supports JDK 1.1 on Windows and therefore requires a JDK 1.1 compatible driver. Consequently, in order to do development and testing on Windows 2000, two versions of a particular JDBC driver are needed. One that is JDK 1.3 compatible for the WebObjects 5 runtime, and another that is JDK 1.1 compatible for use by EOModeler and the Java Bridge.

    To use a JDBC 1.1 driver with EOModeler on Windows 2000, you should add it to the JavaConfig.plist. This is the Oracle driver classes111.zip in this case. If your WebObjects installation is not in C:/Apple, substitute the appropriate path below. The Unix notation of "/" for the directory separator is used in the samples

    1. Log in with an administrator account.
    2. Copy classes111.zip to C:/Apple/Library/Java/
    3. Edit the file C:/Apple/Library/Java/JavaConfig.plist
    4. Add $NEXT_ROOT/Library/Java/classes111.zip to the entry for the "DefaultClasspath". Items in the list should be separated by a semicolon ";". Use the term "$NEXT_ROOT" literally, following the pattern of the other entries.


    Note: If Windows is used only as a deployment platform, then the JDK 1.1 compatible driver is not needed.

Setting up the proper connection dictionary for EOModeler and Oracle JDBC drivers

The EOModeler login panel shows three textfields:

Username: Enter the username such as scott

Password: Enter the password such as tiger

URL: By definition, the JDBC URL has the following format:

jdbc:oracle:drivertype:user/password@database

drivertype - Is thin for the Oracle thin driver, or oci8 if you have downloaded the OCI driver that includes the jdbcoci8.dll file. The oci8 driver can access either an Oracle7 or an Oracle8 server.

user/password - Is not needed in the EOModeler URL textfield, since it is already specified in the two other textfields.

@database - For JDBC OCI drivers: An entry in the tnsnames.ora file.

For JDBC Thin: A string of the form host:port:sid

Example 1: Oracle JDBC Thin driver

Username: scott

Password: tiger

URL: jdbc:oracle:thin:@myServer:1521:myServerID

myServer is the hostname

myServerID is an Oracle sid defined in your tnsnames.ora file.

Note: If you installed the OCI client libraries on Windows, the tnsnames.ora file resides in: $ORACLE_HOME/network/admin

Troubleshooting connection errors


Published Date: Feb 20, 2012