Before you write and deploy your JDBC applications, you may need to include specific jar files in your classpath.
For core Java™ Database Connectivity (JDBC) access to the local database, there are no requirements. All support is built in, preinstalled, and configured.
If you need to use the classes of the JDBC 2.0 optional package, you must include the jdbc2_0-stdext.jar file in your classpath. This Java ARchive (JAR) file contains all the standard interfaces that you need to write your application to use the JDBC 2.0 optional package. To add the JAR file to your extensions classpath, create a symbolic link from the UserData extensions directory to the location of the JAR file. You only need to perform this once; the JAR file in the JDBC 2.0 optional package is always available to your applications at runtime. Use the following command to add the optional package to the extensions classpath:
ADDLNK OBJ('/QIBM/ProdData/OS400/Java400/ext/jdbc2_0-stdext.jar') NEWLNK('/QIBM/UserData/Java400/ext/jdbc2_0-stdext.jar')
Note: This requirement is only for J2SDK 1.3. Since J2SDK 1.4 is the first release with JDBC 3.0 support, all of JDBC (that is, the core JDBC and the optional package) moves into the base J2SDK runtime JAR file that your program always finds.
If you need to use the Java Transaction API (JTA) in your application, you must include the jta-spec1_0_1.jar file in your classpath. This JAR file contains all the standard interfaces that you need to write your application to use JTA. To add the JAR file to your extensions classpath, create a symbolic link from the UserData extensions directory to the location of the JAR file. This is a one-time operation and once completed, the JTA JAR file is always available to your application at runtime. Use the following command to add JTA to the extensions classpath:
ADDLNK OBJ('/QIBM/ProdData/OS400/Java400/ext/jta-spec1_0_1.jar') NEWLNK('/QIBM/UserData/Java400/ext/jta-spec1_0_1.jar')
The native JDBC driver is compliant with all relevant JDBC specifications. The compliance level of the JDBC driver is not dependent on the i5/OS™ release, but on the JDK release you use. The native JDBC driver's compliance level for the various JDKs is listed as follows:
J2SDK release | JDBC driver's compliance level |
---|---|
JDK 1.1 | This JDK is compliant with JDBC 1.0. |
JDK 1.2 | This JDK is compliant with JDBC 2.0 and supports JDBC 2.1 optional package. |
JDK 1.3 | This JDK is compliant with JDBC 2.0 and supports JDBC 2.1 optional package (there were no JDBC-related changes for JDK 1.3). |
JDK 1.4 and subsequent versions | These JDK versions are compliant with JDBC 3.0, but the JDBC optional package no longer exists (support for it is now part of the core JDK). |