Anda di halaman 1dari 3

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&d...

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: 10.1.3.0.0 to 10.1.3.4.0 - Release: AS10gR3 to AS10gR3 JDBC - Version: 10.2.0.0 to 11.1.0.7 [Release: to 11.1] Information in this document applies to any platform.

Goal
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 10.1.0.5 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.

Solution
1. Download the JDBC driver from the link below that you require: http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html 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 11.1.0.7 , 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 (11.1.0.7), (11.1.0.6) drivers Oracle Database 10g Release 2 (10.2.0.4), (10.2.0.3), (10.2.0.2), (10.2.0.1.0) 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 10.2.0.3 JDBC driver, if you were using 11.1.0.7 then the library version would be 11.1.0.7 in that case.

Shared Library Name : oracle.jdbc Shared Library Version : 10.2.0.3

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 11.1.0.7 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 "10.2.0.3" 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

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&d...

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 10.2.0.3 jdbc driver as the default. <import-shared-library name="oracle.jdbc" min-version="10.2.0.3"/> 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 10.2.0.3 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. http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapjdbclib/doc/readme.html 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. http://www.oracle.com/technology/software/products/ias/files/oracle_soa_certification_101310.html 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="10.2.0.4"> <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 http://download-west.oracle.com/docs/cd/B25221_03/web.1013/b14433/classload.htm#sthref58 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

References
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

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&d...

CONFIGURATION; JDBC DRIVER; SHARED LIBRARY; OC4J Back to top

3 de 3

25/02/2011 11:39