SAPTechno

Note 867176 - FAQ: Oracle JDBC

Header
Version / Date 6 / 2011-08-16
Priority Recommendations/additional info
Category FAQ
Primary Component BC-DB-ORA Oracle
Secondary Components

Summary
Symptom

Oracle JDBC connections

Other terms

JDBC JDK THIN Driver

Reason and Prerequisites
    1. What is JDBC?
    2. What JDBC Drivers Oracle Provide?
    3. Which JDBC driver version is certified to connect to which database version?
    4. Which JDK version goes with which driver version?
    5. What are the Driver file names?
    6. What Driver use SAP J2EE?
    7. Are Oracle's JDBC zip and jar files identical on all platforms?
    8. Where do you find the JDBC thin driver?
    9. How to update the JDBC thin Driver?
    10. How to determine which JDBC driver a java program uses?
Solution
    1. What is JDBC?

              JDBC technology is an API that lets you access and manipulate virtually any tabular data source from the Java programming language.

    2. What JDBC Drivers Oracle Provide?

              Oracle supplies 4 driver types:

              1)JDBC Thin Driver.

              2)JDBC OCI Driver.

              3)JDBC Server Driver.

              4)JDBC Server-Side Internal Driver.

              SAP only supports the JDBC Thin Driver. The FAQ will centrate in this Driver.

    3. Which JDBC driver version is certified to connect to which database version?

              From the Oracle side:

              The Oracle 10g and 11g JDBC drivers are certified to work with currently-supported versions of the database.

              JDBC 8i/9i Thin drivers are certified to work with supported (previous) versions of the database.

              JDBC drivers >= 9.2. 0 are certified to work with Oracle Database 10g 10g and 11g.

              From the SAP side:

              SAP only supports homogeneus setups. The oracle driver major version must match the database major version, and the driver version must not be smaller than the database version.

              SAP does not support Oracle 8i drivers.

    4. Which JDK version goes with which driver version?

              9.2.0 THIN Driver - JDK 1.1.x, JDK 1.2. x, JDK 1.3.x, and JDK 1.4.x

              10.1.0 THIN Driver - JDK 1.2.x, JDK 1.3. x, and JDK 1.4.x

    5. What are the JDBC Driver file names?
    Oracle Version  JDK Version   Driver File Name
    11.2.0             1.6.x      ojdbc6.jar
    11.2.0             1.5.x      ojdbc5.jar
    10.2.0             1.5.x      ojdbc14.jar
    10.2.0             1.4.x      ojdbc14.jar
    10.2.0             1.3.x      classes12.jar
    10.2.0             1.2.x      classes12.jar
    6. What Driver use SAP J2EE?

              SAP J2EE applications with release < 7. 00 run with jdbc driver from classes12.jar. SAP J2EE applications release 7.00 run with jdbc driver from ojdbc14.jar.

    7. Are Oracle's JDBC zip and jar files identical on all platforms?

              Yes, The .zip and . jar files are identical on all platforms.

    8. Where do you find the JDBC thin driver?

              On a standard Oracle installation the thin driver can be located on the ORACLE_HOME/jdbc directory. They are also delivered together the oracle instant client.

              Each SAP installation contains a copy of an Oracle JDBC driver. These copies are usually  stored under  /usr/sap/<SID>/JC|DVEBMGS/j2ee/... in Unix systems and

               <DRIVE>:\usr\sap\<SID> \JC|DVEBMGS\j2ee\... in Windows systems.

              The location and driver name is generally stored in the config.properties file in the directory

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

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

              This location can also be changed using the Config Tool. Follow the path

              Instance -> dispatcher -> server -> managers -> ConfigurationManager

              In addition to the driver copies on the file system level, there are also copies of the JDBC driver in the XI J2EE engine.

    9. How to update the JDBC thin Driver?

              See note 915079 for details on updating the JDBC Thin driver.

    10. How to determine the JDBC driver version a java program uses?

              In order to find out the version of the JDBC driver you have to use the attached program.

              1) download the file JdbcCheckup. sar to a temporal directory

              2) extract the file with the command    sapcar -xvf JdbcCheckup.sar

              3) find the location and file name of the driver ( as explained before )

              4) compile the program    Windows
      javac -classpath <path to driver>/<driver filename>;.
                                                 JdbcCheckup.java
   UNIX/Linux
      javac -classpath <path to driver>/<driver filename>:.
                                                 JdbcCheckup.java

              5) Execute the program    Windows
      java -classpath <path to driver>/<driver filename>;. JdbcCheckup
   UNIX/Linux
      java -classpath <path to driver>/<driver filename>:. JdbcCheckup

              The program request the information needed to connect to the database ( username, password, TNSNAME entry, hostname and listener port ) and returns the database and JDBC driver version.

              The required information can be found on the Secure Store in ConfigTool
(if you can connect to the NW Database they are correct)

              jdbc/pool/ME1/User (usually SAPSR3DB)

              jdbc/pool/ME1/Password

              jdbc/pool/ME1/Url (DB server, port, SID are here)

              

              The port can also be found out on the listener.ora file located on the
$ORACLE_HOME/admin/listener on the database Server.

Related Notes
1003198J2EE: Incorrect data with Oracle10g JDBC lower than 10.2.0.4
950454Date problem on the J2EE and Portal applications using JDBC
941594J2EE: External Oracle databases as JDBC DataSources
939424J2EE: Data loss in BLOBs with Oracle 10g JDBC < 10.2.0.2
922080OOM in SAP J2EE applications on Oracle 9i
915079J2EE on Oracle: Updating the JDBC drivers
599110Data corruption using JDBC and NCLOBs
509719How to install Oracle JDBC Drivers