Tuesday, October 4, 2011

How to Use The Latest Thin JDBC Driver Across All Applications For a 10.1.3.x OAS Container

Visit the Below Website to access unlimited exam questions for all IT vendors and Get Oracle Certifications for FREE
http://www.free-online-exams.com
Problem: How to Use The Latest Thin JDBC Driver Across All Applications For a 10.1.3.x OAS Container

Symptoms:
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]

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.


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://:/em

3. Select the OC4J container that you wish to use the latest JDBC driver for.
4. Click on the "Administration" link.
5. Click on the "Shared Libraries", go to task icon.
6. Click the "Create" button.
7. 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//config/system-application.xml

14. Locate the following line:



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.



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.










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:


How to Use The Latest Thin JDBC Driver Across All Applications For a 10.1.3.x OAS Container [ID 420303.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
Get Oracle Certifications for all Exams
Free Online Exams.com

No comments: