Anda di halaman 1dari 3

How to Use The Latest Thin JDBC Driver Across All Applications For a 10.1.3.x OAS Container [ID 420303.1] Modified 03-JAN-2011 In this Document Goal Solution More Information References Type HOWTO Status PUBLISHED

Applies to:
Oracle Containers for J2EE - Version: to - Release: AS10gR3 to AS10gR3 JDBC - Version: to [Release: to 11.1] Information in this document applies to any platform.

This how-to describes how to upgrade the JDBC thin driver that all applications use within the container through a shared library. This is a new feature in OAS 10.1.3.x. Note: Unless there is a pressing need to switch from the default JDBC driver you should be very careful about replacing the driver for all applications as shown below. In most cases just switching the JDBC driver for a single application may be all you need.

1. Download the JDBC driver from the link below that you require: OAS 10.1.3.x supports the use of the 10.2.x and 11.1.x JDBC drivers as shown below, so you can use any of these but it is preferred you use the latest version of the driver where you can. So if you wish to use 11g JDBC driver then please use , which at the time of this article was the latest driver for 11g. For more information see Note 365120.1 - JDBC Driver Support for Oracle Application Server Oracle Database 11g Release 1 (, ( drivers Oracle Database 10g Release 2 (, (, (, ( drivers 2. Log into ASC (Application Server Control): http://<server>:<port>/em 3. 4. 5. 6. 7. Select the OC4J container that you wish to use the latest JDBC driver for. Click on the "Administration" link. Click on the "Shared Libraries", go to task icon. Click the "Create" button. Enter in the following details:

This example is based on using the JDBC driver, if you were using then the library version would be in that case.

Shared Library Name : oracle.jdbc Shared Library Version :

8. Click "Next". 9. Click on the "Add" button. 10. Browse to your downloaded JDBC thin jar file, Eg: ojdbc14.jar, or ojdbc5.jar if using JDBC driver. 11. Press the "Continue" button. 12. Press the "Finish" button. You should receive a confirmation stating the shared library has been created and the list of shared libraries should show your newly created "oracle.jdbc" library with a name as "" is in the list. With the shared library added, we now need to alter the "system-application.xml" file for the container to enable the new JDBC driver as the default driver for the container and all of its applications. Perform the following steps to achieve this: 13. Open the system-application.xml file. Ensure you use correct container directory, in this case our container is called "pear". $ORACLE_HOME/j2ee/<container-name>/config/system-application.xml

1 de 3

25/02/2011 11:39

14. Locate the following line: <import-shared-library name="oracle.jdbc" /> 15. Alter this line (or add it if no line exist from step 14) to include the new shared library. This ensures applications for this container will inherit the jdbc driver as the default. <import-shared-library name="oracle.jdbc" min-version=""/> 16. Save the file and restart the container. You may need to use "opmnctl stopall/startall" for this change to take affect. > opmnctl stopproc process-type=pear > opmnctl startproc process-type=pear With this done you will now be using the JDBC thin driver for all applications deployed to the container "pear". If you wish to override this for a specific application in the container "pear", then we can still do that. The following link shows how to change the driver for a specific application itself, giving you full control over applications you deploy to use the driver you require. Use Note 396187.1 which has a simple EAR to test which driver version an application is using. If your using the 11g JDBC driver you must download and use ojdbc5.jar for JDK 1.5 or ojdbc6.jar for JDK 1.6. If you are using JDK 1.4 which you can do with OAS 10.1.3.x then you can't use JDBC 11g drivers as they require JDK 1.5 or above to work and do not support JDK 1.4. For more details on OAS 10.1.3.x certification see the link below. Also please verify if ojdbc14.jar is all you require or not by testing this in a DEV or QA environment where you are using JDBC applications. The complete oracle.jdbc library shipped by oracle is defined as follows which may mean you require those JAR files as well.

<shared-library name="oracle.jdbc" version=""> <code-source path="ojdbc14dms.jar"/> <code-source path="orai18n.jar"/> <code-source path="$ORACLE_HOME/j2ee/home/lib/ojms-provider.jar"/> <code-source path="$ORACLE_HOME/jdbc/lib/ocrs12.jar"/> <code-source path="$ORACLE_HOME/opmn/lib/ons.jar"/> <code-source path="$ORACLE_HOME/rdbms/jlib/aqapi.jar"/> <import-shared-library name="oracle.dms"/> </shared-library>

In most cases ojdbc14.jar is all that is required. If that's not the case the other JAR files can be added as there locations are shown. You should not use $ORACLE_HOME but rather the full path to the JAR files. For the implications of adding a new oracle.jdbc shared library and what you need to be aware of see Note 787689.1

More Information
1. Oracle Containers for J2EE Developer's Guide 10g Release 3 (10.1.3) Part No. B14433-01 2. Installing/Configuring OAS 10.1.3.x to use Different Oracle JDBC Driver Versions Note 787689.1 3. JDBC Driver Support for Oracle Application Server Note 365120.1

NOTE:365120.1 - JDBC Driver Support for Oracle Application Server (Fusion Middleware) NOTE:787689.1 - Installing/Configuring OAS 10.1.3.x to use Different Oracle JDBC Driver Versions

Related Products Middleware > Application Servers > Oracle Application Server > Oracle Containers for J2EE Middleware > Developer Tools > Java Development > JDBC Keywords

2 de 3

25/02/2011 11:39


3 de 3

25/02/2011 11:39