Using Third-Party JDBC Drivers with WebLogic Server

来源:互联网 发布:小卖家淘宝日常运营 编辑:程序博客网 时间:2024/06/10 22:20

Using Third-Party JDBC Drivers with WebLogic Server

WebLogic Server works with third-party JDBC drivers that offer the following functionality:

  • Are thread-safe
  • Can implement transactions using standard JDBC statements

Third-party JDBC drivers that do not implement Serializable or Remote interfaces cannot pass objects to a remote client application.

This section describes how to set up and use third-party JDBC drivers with WebLogic Server. It includes the following sections:

  • Third-Party JDBC Drivers Installed with WebLogic Server
  • Setting the Environment for a Type-4 Third-Party JDBC Driver
  • Globalization Support for the Oracle 11g Thin Driver
  • Using the Oracle Thin Driver in Debug Mode


Third-Party JDBC Drivers Installed with WebLogic Server

The following third-party JDBC drivers are installed with WebLogic Server:

  • Oracle Thin Driver 11g version of the Oracle Thin driver (ojdbc6_g.jar for JDK 6, andojdbc5_g.jar for JDK 5)
  • Sybase jConnect 4.5 (jConnect.jar), 5.5 (jconn2.jar), and 6.0 (jconn3.jar)
  • MySQL 5.0.x (mysql-connector-java-commercial-5.0.x-bin.jar)

These drivers are installed in the WL_HOME\server\lib folder (where WL_HOME is the folder where WebLogic Server is installed) with weblogic.jar. The manifest in weblogic.jar lists these files so that they are loaded whenweblogic.jar is loaded (when the server starts). Therefore, you do not need to add these JDBC drivers to yourCLASSPATH. If you plan to use a third-party JDBC driver that is not installed with WebLogic Server, you must install the drivers, which includes updating yourCLASSPATH with the path to the driver files, and may include updating yourPATH with the path to database client files. See “Supported Database Configurations” inSupported Configurations for WebLogic Server.

Note:The WebLogic Type 4 JDBC drivers from DataDirect are also installed with WebLogic Server. SeeType 4 JDBC Drivers for more information.

If you plan to use a different version of any of the drivers installed with WebLogic Server, you can replace the driver file inWL_HOME\server\lib with an updated version of the file or add the new file to the front of yourCLASSPATH.

Copies of the drivers installed with WebLogic Server and other supporting files are installed inWL_HOME\server\ext\jdbc\. There is a subdirectory in this folder for each DBMS. If you need to revert to the version of the driver installed with WebLogic Server, you can copy the file fromWL_HOME\server\ext\jdbc\DBMS toWL_HOME\server\lib.

Note:WebLogic Server also includes the PointBase 5.7 JDBC driver and an evaluation version of the PointBase DBMS installed with the WebLogic Server examples inWL_HOME\common\eval\pointbase. PointBase Server is an all-Java DBMS product included in the WebLogic Server distribution solely in support of WebLogic Server evaluation, either in the form of custom trial applications or through packaged sample applications provided with WebLogic Server. Non-evaluation development or production use of the PointBase Server requires a separate license be obtained by the end user directly fromPointBase.


Setting the Environment for a Type-4 Third-Party JDBC Driver

If you plan to use a third-party JDBC driver that is not installed with WebLogic Server, you need to update the WebLogic Server’s classpath to include the location of the JDBC driver classes. Edit the commEnv.cmd/sh script in WL_HOME/common/bin and prepend your classes as described in“Modifying the Classpath” in the WebLogic ServerCommand Reference.


Globalization Support for the Oracle 11g Thin Driver

For Globalization Support with the 11g version of the Oracle Thin driver, Oracle supplies theorai18n.jar file, which replaces nls_charset.zip. If you use character sets other than US7ASCII, WE8DEC, WE8ISO8859P1 and UTF8 with CHAR and NCHAR data in Oracle object types and collections, you must includeorai18n.jar in your CLASSPATH.orai18n.jar is included with the WebLogic Server installation in theWL_HOME\server\ext\jdbc\oracle\11g folder. The file isnot referenced by the weblogic.jar manifest file, so you must add it to yourCLASSPATH before you can use it.


Using the Oracle Thin Driver in Debug Mode

The WL_HOME\server\ext\jdbc\oracle\11g folder includes theojdbc6_g.jar (for JDK 6) and ojdbc5_g.jar (for JDK 5) files, which are the versions of the Oracle Thin driver with classes to support debugging and tracing. To use the Oracle Thin driver in debug mode, add the path to these files at the beginning of your CLASSPATH.


原创粉丝点击