BEA Home | Events | Solutions | Partners | Products | Services | Download | Developer Center | WebSUPPORT
| WebLogic Server Doc Home | WebLogic jDriver for Oracle | Previous Topic | Next Topic | Contents | View as PDF

Installing WebLogic jDriver for Oracle

This section discusses the following topics:

- Preparing to Install WebLogic jDriver for Oracle

- Installation Procedures for WebLogic jDriver for Oracle

- After Installing WebLogic jDriver for Oracle

Preparing to Install WebLogic jDriver for Oracle

Before installing the WebLogic jDriver for Oracle, you must complete the tasks described in this section:

- Checking Software Requirements for WebLogic jDriver for Oracle

- Setting Up the Environment for Using WebLogic jDriver for Oracle

Checking Software Requirements for WebLogic jDriver for Oracle

This section lists the software requirements in the following areas:

- Supported Platforms

- Requirements for Running JDBC 2.0

Supported Platforms

For details about the platforms, operating systems, JVMs, DBMS versions, and client libraries supported by the WebLogic jDrivers, see Platform Support for Weblogic jDrivers.

Requirements for Running JDBC 2.0

WebLogic Server 6.1 runs under the JDK 1.3.1 platform, supporting the JDBC 2.0 API— The JDBC 2.0 Core API and the JDBC Optional Package API that includes distributed transactions. In addition, you must use a driver that uses the Oracle Call Interface version 8 API.

Setting Up the Environment for Using WebLogic jDriver for Oracle

To set up your environment to support the use of WebLogic jDrivers, you must set your path variable to include pathnames for the following:

- The directory that contains your driver. (The driver file could be a native dll, so, or sl file.) The file containing the driver must be available to your WebLogic Server client. The name of the path variable depends on the system you are using:

  - On a Windows NT system, set PATH.

  - On most UNIX systems, set LD_LIBRARY_PATH.

  - On an HP-UX system, set SHLIB_PATH.

    The directory containing the driver file varies, depending on several factors discussed in the following text.

- The directory in which vendor-supplied libraries from Oracle reside. The location of the directory containing your Oracle client libraries varies, depending on your installation. On Windows NT, the Oracle installer places these libraries in your system path.

WebLogic Server uses the dll, so, or sl files built with the Oracle Call Interface (OCI) version 8 API as the native interface for accessing an Oracle DBMS.

The tables in the following platform-specific sections list the directories—based on the Oracle client version—that you must specify in your system PATH to access the desired version of the driver.

Windows NT

Add the pathnames for the WebLogic shared library (.dll) directory and the directory where you installed the Oracle client to the PATH as follows:

Syntax

Use the following syntax:

- Add WL_HOME\bin\ and the appropriate WebLogic Server shared library directory from the table below to your PATH, where WL_HOME is the directory of your WebLogic Server installation. For example:

  >     %WL_HOME%\bin\oci

- Add ORACLE_HOME\bin to your PATH, where ORACLE_HOME is the directory of your Oracle client installation. Always add the WebLogic jDriver for Oracle and Oracle home information at the beginning of your PATH. For example:

  >     %ORACLE_HOME%\bin;%PATH%

Example

Using the above syntax to create an actual example for Oracle 8.1.7, your path may look like:

>     $set PATH=%WL_HOME%\bin\oci817_8;c:\ORANT817\bin;%PATH%

Where ocixx is oci817_8, and ORACLE_HOME is c:\ORANT817.

For Oracle 9.0.1, your path may look like:

>     $set PATH=%WL_HOME%\bin\oci901_8;c:\ORANT901\bin;%PATH%

The following table provides the directory and Oracle client versions for Windows NT.

Table 2-1 Oracle on Windows NT

Oracle Client Version | OCI API Version | Shared Library (.dll) Directory | Notes
--- | --- | --- | ---
8.1.7 | 8 | oci817_8 | Allows access to Oracle 8 and JDBC 2.0 Core API and Optional Package API (includes distributed transactions).
9.0.1 | 8 | oci901_8 | Allows access to Oracle 9 and JDBC 2.0 Core API and Optional Package API (includes distributed transactions).
9.2.0 | 8 | oci920_8 | Allows access to Oracle 9 and JDBC 2.0 Core API and Optional Package API (includes distributed transactions).

Solaris

To set up your Solaris environment to support the use of WebLogic jDrivers, you must set your environment variable LD_LIBRARY_PATH to include 1) the directory in which you installed the Oracle client, and 2) the directory that contains the native interface file.

Syntax

Use the following syntax:

- The directory in which the native interface libweblogicocixx.so resides. For example:

  >     $WL_HOME/lib/solaris/oci

- The directory in which vendor-supplied libraries from Oracle reside. The location of the directory containing your Oracle client libraries varies, depending on your installation. For example:

  >     $ORACLE_HOME/lib

Example

Using the above syntax to create an actual path for Oracle 8.1.7, your path may look like:

>     export LD_LIBRARY_PATH=
>     $WL_HOME/lib/solaris/oci817_8:ORACLE/lib:$LD_LIBRARY_PATH

Where ocixx is oci817_8, and ORACLE_HOME is /ORACLE/.

The following table provides the directory and Oracle client versions for Solaris.

Table 2-2 Oracle on Solaris

Oracle Client Version | OCI API Version | Shared Library (.so) Directory | Notes
--- | --- | --- | ---
8.1.7 | 8 | oci817_8 | Allows access to Oracle 8 and JDBC 2.0 Core API and Optional Package API (includes distributed transactions).
9.0.1 | 8 | oci901_8 | Allows access to Oracle 9 and JDBC 2.0 Core API and Optional Package API (includes distributed transactions).
9.2.0 | 8 | oci920_8 | Allows access to Oracle 9 and JDBC 2.0 Core API and Optional Package API (includes distributed transactions).

IBM AIX

To find out if your platform is supported, see BEA WebLogic Server Platform Support.

HP-UX 11

To set up your HP environment to support the use of WebLogic jDrivers, you must set your environment variable SHLIB_PATH to include 1) the directory in which you installed your Oracle client, and 2) the directory that contains the native interface file.

Note: Oracle 9 for HP-UX is available in a 64-bit version only, including the Oracle client. Because the WebLogic jDriver for Oracle is a type-2 JDBC driver, it requires the Oracle client for database access. Therefore, to use the WebLogic jDriver for Oracle with Oracle 9 on HP-UX, you must run WebLogic Server on a 64-bit machine.

Syntax

For Oracle 8, use the following syntax:

- The directory in which the native interface file weblogicocixx.sl resides. For example:

  >     $WL_HOME/lib/hpux11/ocixx

- The directory in which vendor-supplied libraries from Oracle reside. The location of the directory containing your Oracle client libraries varies, depending on your installation. For example:

  >     $ORACLE_HOME/lib

For Oracle 9i, use the following syntax:

- The directory in which the native interface file weblogicocixx.sl resides. For example:

  >     $WL_HOME/lib/hpux11/ocixx

- The directory in which vendor-supplied libraries from Oracle reside. The location of the directory containing your Oracle client libraries varies, depending on your installation. For example:

  >     $ORACLE_HOME/lib32

Example

Using the above syntax to create an actual path for Oracle 8.1.7, your path may look like:

export SHLIB_PATH=
$WL_HOME/lib/hpux11/oci817_8:ORACLE/lib:$SHLIB_PATH

Where ocixx is oci817_8, and ORACLE_HOME is ORACLE.

For Oracle 9.0.1, your path may look like:

export SHLIB_PATH=
$WL_HOME/lib/hpux11/oci901_8:ORACLE/lib32:$SHLIB_PATH

The following table provides the directory and Oracle client versions for HP-UX.

Table 2-3 Oracle on HP

Oracle Client Version | OCI API Version | Shared Library (.sl) Directory | Notes
--- | --- | --- | ---
8.1.7 | 8 | oci817_8 | Allows access to Oracle 8 and JDBC 2.0 Core API and Optional Package API (includes distributed transactions).
9.0.1 | 8 | oci901_8 | Allows access to Oracle 9 and JDBC 2.0 Core API and Optional Package API (includes distributed transactions).
9.2.0 | 8 | oci920_8 | Allows access to Oracle 9 and JDBC 2.0 Core API and Optional Package API (includes distributed transactions).

SGI IRIX

To find out if your platform is supported, see BEA WebLogic Server Platform Support.

Siemens MIPS

To find out if your platform is supported, see BEA WebLogic Server Platform Support.

Compaq Tru64 UNIX

To find out if your platform is supported, see BEA WebLogic Server Platform Support.

Installation Procedures for WebLogic jDriver for Oracle

The instructions in this document assume that you are installing WebLogic Server on a computer running the Microsoft Windows operating system and that you are unpacking the archive in the root directory of your C drive. If you are installing on a different operating system or in a different location, check your system documentation for help in adjusting the commands shown in these instructions for your own environment.

The following instructions are for installing WebLogic jDriver for Oracle on servers with Oracle and WebLogic Server, and for installing WebLogic jDriver for Oracle as a stand-alone type-2 JDBC driver (separate from WebLogic Server). For installations with WebLogic Server follow only Steps 1 and 2 below, and Step 5 if you are using WebLogic Server to access databases via applets. For stand-alone installations, follow all the steps.

1. Select the appropriate native library for your environment.

   WebLogic Server is shipped with dll, sl, or so files for various combinations of Oracle client versions, APIs, and platforms. You must place the appropriate file in your system's path or shared library path for this driver to function. Unlike previous releases of WebLogic Server, which had only one such file that was always present in the default path, you now must specify this path setting explicitly. For details and instructions on setting these options, see Setting Up the Environment for Using WebLogic jDriver for Oracle.

2. Add the client libraries from your Oracle installation to your system PATH (Windows NT) or load library path (UNIX—the name of this variable differs among UNIX systems). Check your Oracle documentation for the location of these libraries. On most Windows NT platforms, the client libraries are located in c:\ORANT\bin.

3. Unpack the distribution.

   If you have purchased WebLogic Server, WebLogic jDriver for Oracle is provided with your distribution. No further steps are required to unpack the distribution. The remainder of these installation steps are required only for users of the stand-alone version of WebLogic jDriver.

   If you have not already unpacked the archive you downloaded in the root directory of your computer, you should unpack it now. You must use a program such as WinZip that preserves the directory structure of the archive. The files are unpacked into the weblogic directory.

4. Add the WebLogic Server classes directory to your CLASSPATH variable.

   Note: If you are using the WebLogic jDriver for Oracle that is bundled with the WebLogic Server software, the CLASSPATH settings are the same as those required for WebLogic Server. The standard startup scripts supplied with the WebLogic Server distribution will do this for you.

   To change your CLASSPATH temporarily at a Windows Command Prompt, use this command:

   >     $set CLASSPATH=%CLASSPATH%;c:\weblogic\oracle\classes

   To change your CLASSPATH permanently:

   1. Double-click the System icon in the Control Panel.

   2. Click the Environment tab.

   3. In the lower panel, select the CLASSPATH variable. If no CLASSPATH variable is defined, add it.

   4. Add %WL_HOME%\oracle\classes to the value of the CLASSPATH variable. Use a semicolon (;) to separate the new path from the previous value of the variable, if any.

      Any program you launch after you update the CLASSPATH variable in the System control panel has access to the new value.

      For more help with setting your CLASSPATH, see Compiling and Deploying WebLogic Server in Developing WebLogic Server Applications. If you are using WebLogic Server from within an IDE like Symantec Cafe or JBuilder, the procedure for adding classes to the CLASSPATH may be different.

5. Install license file.

After Installing WebLogic jDriver for Oracle

This section describes the tasks you must perform after installing the WebLogic jDriver for Oracle software:

- Licensing Functionality

- Checking Connections to the Oracle Database

- Setting Up a Connection Pool

Licensing Functionality

The Oracle licensing functionality is included in the license file located in the BEA home directory where you installed this WebLogic Server. For example:

>     c:\bea\license.bea

Checking Connections to the Oracle Database

Once you have installed WebLogic jDriver for Oracle, verify that you can use it to connect to your database. To test your connection, use a utility called dbping that is provided with the WebLogic Server software.

To set your environment to use dbping, type the following on the command line (in a single line):

>     %WL_HOME%\config\mydomain\setEnv.cmd
>     java utils.dbping ORACLE user password server

Replace %WL_HOME% with the path for the directory that contains your WebLogic Server or WebLogic Server installation.

For detailed instructions on verifying your connection to a DBMS, see Testing connections.

If you have problems, check Troubleshooting WebLogic JDBC in Programming WebLogic JDBC.

Setting Up a Connection Pool

If you are using WebLogic jDriver for Oracle with either BEA WebLogic Server or BEA WebLogic Express, you can set up a pool of connections to your Oracle DBMS to be established when WebLogic Server starts. Because the connections are shared among users, these connection pools eliminate the overhead of opening a new database connection for each user.

Your application then uses a multitier (Type 3) JDBC driver, such as the WebLogic Pool, or RMI driver to connect to the WebLogic Server software. The WebLogic Server software then uses WebLogic Server and one of the existing connections from the pool to connect to the Oracle database on behalf of your application.

Configuring a Connection Pool with WebLogic Server Software

1. Include the vendor-supplied native libraries and the WebLogic native libraries for WebLogic Server in the PATH (Windows) or load library path (UNIX) of the shell where you will start WebLogic Server. For more information, see Starting and Stopping WebLogic Servers in the Administration Guide.

2. Use the Administration Console to set connection pools. To read about connection pools, see Connection Pools in the Administration Guide or, to go directly to the procedure, see Create a JDBC Connection Pool in Online Help.

3. Start the WebLogic Server software.

Using the Connection Pool in an Application

To use a connection pool in this type of application . . . | Establish a database connection using . . . | For details, see . . .
--- | --- | ---
Server-side (such as a servlet) | WebLogic Pool, JTS, and WebLogic jDriver for Oracle/XA drivers | Connecting To a Database Using a JDBC Connection Pool in Programming WebLogic HTTP Servlets.
Creating a startup connection pool in Administration Guide.

Using IDEs or Debuggers with WebLogic jDrivers

If you are using Symantec Cafe or any other IDE, or a debugger, copy the WebLogic-supplied native library to a new file with a name (excluding the extension) that ends in _g. For example,

- On a UNIX system, copy libweblogicoci37.so to libweblogicoci37_g.so. For distributed transactions, copy libweblogicoxa37.so to libweblogicoxa37_g.so.

- On a Windows NT platform, copy weblogicoci37.dll to weblogicoci37_g.dll. For distributed transactions, copy weblogicoxa37.dll to weblogicocoxa37_g.dll.

Preparing to Set Up a Development Environment and Use the WebLogic jDriver for Oracle

For more information, read the following:

For information about . . . | See the section called . . .
--- | ---
Using the driver | Using WebLogic jDriver for Oracle

Copyright © 2001 BEA Systems, Inc. All rights reserved. Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.