To access DB2, Java uses either dynamic SQL or static SQL. Dynamic SQL is supported by the JDBC standard, Java database connectivity, which basically is a Java implementation of ODBC. Static SQL is supported by SQLJ. While JDBC is an open standard that can interact with most database management systems, SQLJ is specific to DB2.

Prerequisites

Before you can access DB2 from your Java application, these prerequisites must be in place:

￿Java runtime environment:

Because Java is an interpreted language, the runtime environment is required in order to execute the bytecode. The runtime environment is platform dependent and must match the operating system.

￿IBM Data Server Driver:

If either IBM Data Server Client or IBM Data Server Runtime Client is present, installing the IBM Data Server Driver is not required. Otherwise, IBM Data Server Driver for JDBC and SQLJ is required to run the application.

Installation procedure

First of all, you have to install the Java runtime environment (JRE), which usually does not come with the operating system. For all the different operating systems, you must ensure that the version of the installed JRE matches the architecture of the operating system. That is, you must use a 64-bit JRE on a 64-bit platform and a 32-bit JRE on a 32-bit platform.

￿AIX:

Usually AIX is shipped with a Java runtime environment. The current level shipped with AIX 5.3 is 1.4. You can download another version of the JRE from this Web site:

http://www.ibm.com/developerworks/java/jdk/aix/service.html

￿Windows and Linux:

Java runtime environments for non-IBM platforms can be downloaded from this Web site:

https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=jdk-6u6-oth-JPR@CDS-CDS_Develo per

The IBM Data Server Driver installation procedure is described in 4.1.1, “IBM Data Server Driver for JDBC and SQLJ” on page 138.

Chapter 4. Deploying applications with DB2 151

Page 165
Image 165
IBM DB2 manual Prerequisites