SAPTechno

Note 915079 - J2EE on Oracle: Updating the JDBC drivers

Header
Version / Date 25 / 2011-10-20
Priority Recommendations/additional info
Category Consulting
Primary Component BC-DB-ORA-SYS Database Interface / DBMS for Oracle
Secondary Components BC-DB-ORA Oracle

Summary
Symptom
  • You want to localize and update the JDBC driver in your Oracle-based J2EE engine system, or:
  • You imported a patch into the Oracle database software on the central instance. However, the system response of the SAP J2EE applications with respect to JDBC has not been changed by this import, in particular possible errors are not corrected.

Other terms

J2EE, JDBC, Driver, Oracle, Patch

Reason and Prerequisites

The database on which the J2EE engine is based runs on Oracle.

Note

It is generally necessary to differentiate between the driver as such and the references to this driver. This note concerns the update of the existing driver. If the driver directory or the driver name changes, the driver references must be adjusted. In this case, read Note 867976.

Solution

To be able to connect to the database, the J2EE applications require a JDBC driver on the central instance and on the dialog instances. Copies of the JDBC drivers can be used by the applications on the file system level and also in the J2EE engine itself.

As of Version 7.00, in most cases, the J2EE engine uses the JDBC driver from an Oracle Instant Client installation. To allow for this situation, as of Version 10.2.0.4 of the JDBC driver, individual JDBC drivers are no longer provided on SAP Service Marketplace; instead, only the complete Oracle Instant Client software is provided. This ensures that the Oracle Instant Client software on SAP Service Marketplace always contains the current JDBC driver.

As a result, as of Version 10.2.0.4 of the JDBC driver, we recommend that you no longer download only the JDBC driver if you require it; instead, we recommend that you update the entire Oracle Instant Client installation.

Driver files

The Oracle JDBC driver is delivered in one or several driver files.

As of Version 7.00, the J2EE engine uses only the driver file ojdbc14.jar. As of Version 7.20, the J2EE engine uses only the driver file ojdbc6.jar. You do not require other auxiliary files.

Older versions of the J2EE engine use the driver file classes12.jar and, if required, additional auxiliary files.

As of Version 10.2.0.4, we no longer recommend that you replace individual driver files (see above). If, in individual cases, you require a replacement as described above (for example, for driver files that are stored within the J2EE engine), download the Oracle Instant Client software for your platform from SAP Service Marketplace at:
              http://service.sap.com/oracle-download
--> Oracle <XX.X> Software (<YY>-bit)
    --> Installation
        --> <platform>
            --> ORACLE


Use SAPCAR to unpack the SAR file that you downloaded to a temporary directory and place the driver files into the directory that you unpacked.

Driver versions and support

If an Oracle major version covers less Java versions than required by SAP, the Oracle clients provided by SAP contain JDBC drivers for further Oracle versions. As a result, for example, an Oracle 11 client also contains the drivers for Oracle 10 to support Java 1.4 and 5. For these drivers, free support is provided even after the period of free maintenance has expired.

Localizing the driver files at file system level

Copies of the driver files in the file system may exist in three different locations. That is, the Oracle database software itself, any Oracle client installation, and also isolated copies outside the Oracle software.

The driver files are located in the database software in the directory $ORACLE_HOME/jdbc/lib. The Oracle database software is usually only installed on the database instance.

Within the Instant Client installation, the driver files are located directly in the client directory in accordance with Note 819829 (UNIX) or 998004 (Windows). The Oracle Instant Client software can exist both on the central instance and also on the individual dialog instances.

(Older versions of the J2EE engine that may not have an Oracle instant client installation (in particular, in the dialog instances) may contain their own copy of the driver files on individual instances. These copies are stored under /usr/sap/<SID>/JC<XX>|DVEBMGS<XX>/j2ee/...)

To localize the driver files, you must first check which driver file exactly uses the individual J2EE instance. To do this, use a text editor to open the file config.properties for the J2EE instance in the following directory:

   /usr/sap/<SID>/JC<XX>|DVEBMGS<XX>/j2ee/configtool

and search for the property rdbms.driverLocation. The value set for this property indicates the directory and the names of the driver file used on this instance.

If rdbms.driverLocation on Windows points to a driver file in the directory

   <D>:\usr\sap\<SID>\JC<XX>|DVEBMGS<XX>\exe\    ("DIR_EXECUTABLE")

this is only a copy in this case. The actual driver file (with the same name) to be updated is in the directory

   <D>:\usr\sap\<SID>\SYS\exe\uc\<platform>\    ("DIR_CT_RUN")

Updating the driver files at file system level

If the driver files are in the Oracle database software itself, you must use the OPatch utility to update the driver files.

If the driver files are located in an Oracle Instant Client installation and the Instant Client version is 10.2.0.4 or higher, you must update the entire Oracle Instant Client as described in Note 819829 (Unix) or Note 998004 (Windows).

In all other cases, you simply overwrite the files at file level to update the driver files.

Shut down all instances before you overwrite the driver files. Back up the old driver files before you overwrite them.

Localize and update the driver files within the J2EE engine (only XI)

For the XI application, in addition to the driver copies at file system level, there are also copies of the JDBC driver in the J2EE engine. The relevant driver files are therefore persistently stored in the database. In order to update these files, you must to re-deploy the relevant driver files. In this case, you cannot simply overwrite at file system level. This corrupts the driver storage. Detailed instructions for redploying the driver file can be found in the documentation "How to Install and Configure External Drivers" under the following link:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f04ce027-934d-2a10-5a8f-fa0b1ed4d88f

Affected Releases
Software Component Release From Release To Release And subsequent
SAP-JEE606.406.40X

Related Notes
1262744ArrayIndexOutOfBoundsException:-32683 w/Oracle JDBC 10.2.0.4
1174491J2EE: Data corruption w/ Oracle JDBC < 10.2.0.4 and JVM 5.0
1079125EWA GCA Task of Solution Manager Diagnostics
1068391TIMESTAMP values off by one hour on SELECT via JDBC
1003198J2EE: Incorrect data with Oracle10g JDBC lower than 10.2.0.4
998004Update the Oracle Instant Client on Windows
950454Date problem on the J2EE and Portal applications using JDBC
939424J2EE: Data loss in BLOBs with Oracle 10g JDBC < 10.2.0.2
867976Changing JDBC driver on WEB AS Java 6.40/NW 7.0x/7.1x
867176FAQ: Oracle JDBC