IBM Books

Building Applications for UNIX** Environments


Setting the Environment

AIX

To build Java applications on AIX with DB2 JDBC support, you need to install and configure the following on your development machine:

  1. The Java Development Kit (JDK) Version 1.1 for AIX from IBM (refer to http://www.software.ibm.com/data/db2/java).

  2. The DB2 Client Application Enabler for AIX from the DB2 Client Pack. It must be Version 2.1.2 or later.

To run DB2 Java stored procedures or UDFs, you also need to update the DB2 database manager configuration on the server to include the path where the JDK is installed on that machine. You can do this by entering the following on the server command line:

   db2 update dbm cfg using JDK11_PATH /home/db2inst/jdk11

where /home/db2inst/jdk11 is the path where the JDK is installed.

You can check the DB2 database manager configuration to verify the correct value for the JDK11_PATH field by entering the following command on the server:

   db2 get dbm cfg

You may want to pipe the output to a file for easier viewing. The JDK11_PATH field appears near the beginning of the output. For more information on these commands, see the Command Reference.

To run Java programs on AIX with DB2 JDBC support, the following environment variables are automatically updated during DB2 instance creation to ensure that:

To build SQLJ programs, CLASSPATH is also updated to include the file:

   sqllib/java/sqlj.zip

To run SQLJ programs, CLASSPATH is also updated to include the file:

   sqllib/java/runtime.zip

HP-UX

To build Java applications on HP-UX with DB2 JDBC support, you need to install and configure the following on your development machine:

  1. The HP-UX Developer's Kit for Java Release 1.1 from Hewlett-Packard (refer to http://www.software.ibm.com/data/db2/java).

  2. The DB2 Client Application Enabler for HP-UX from the DB2 Client Pack. It must be Version 2.1.2 or later.

To run DB2 Java stored procedures or UDFs, you also need to update the DB2 database manager configuration on the server to include the path where the JDK is installed on that machine. You can do this by entering the following on the server command line:

   db2 update dbm cfg using JDK11_PATH /home/db2inst/jdk11

where /home/db2inst/jdk11 is the path where the JDK is installed.

You can check the DB2 database manager configuration to verify the correct value for the JDK11_PATH field by entering the following command on the server:

   db2 get dbm cfg

You may want to pipe the output to a file for easier viewing. The JDK11_PATH field appears near the beginning of the output. For more information on these commands, see the Command Reference.

To run Java programs on HP-UX with DB2 JDBC support, the following environment variables are automatically updated during DB2 instance creation to ensure that:

To build SQLJ programs, CLASSPATH is also updated to include the file:

   sqllib/java/sqlj.zip

To run SQLJ programs, CLASSPATH is also updated to include the file:

   sqllib/java/runtime.zip

SCO UnixWare 7

To build Java applications on SCO UnixWare 7 with DB2 JDBC support, you need to install and configure the DB2 Client Application Enabler for SCO UnixWare 7 from the DB2 Client Pack. It must be Version 5.2 or later.

SCO UnixWare 7 ships with Java Development Kit Version 1.1.3 installed in the /usr/java directory. You may have to configure it for your environment.

To run DB2 Java stored procedures or UDFs, you also need to update the DB2 database manager configuration on the server to include the path where the JDK is installed on that machine. You can do this by entering the following on the server command line:

   db2 update dbm cfg using JDK11_PATH /home/db2inst/jdk11

where /home/db2inst/jdk11 is the path where the JDK is installed.

You can check the DB2 database manager configuration to verify the correct value for the JDK11_PATH field by entering the following command on the server:

   db2 get dbm cfg

You may want to pipe the output to a file for easier viewing. The JDK11_PATH field appears near the beginning of the output. For more information on these commands, see the Command Reference.

To run Java programs on SCO UnixWare 7 with DB2 JDBC support, the following environment variables are automatically updated during DB2 instance creation to ensure that:

To build SQLJ programs, CLASSPATH is also updated to include the file:

   sqllib/java/sqlj.zip

To run SQLJ programs, CLASSPATH is also updated to include the file:

   sqllib/java/runtime.zip

Silicon Graphics IRIX

To build Java applications on Silicon Graphics IRIX with DB2 JDBC support, you need to install and configure the following on your development machine:

  1. The Java Development Environment 3.1 (Sun JDK 1.1.5) and the Java Execution Environment 3.1 (Sun JRE 1.1.5) from Silicon Graphics, Inc. (refer to http://www.software.ibm.com/data/db2/java).

  2. The DB2 Client Application Enabler for Silicon Graphics IRIX from the DB2 Client Pack. It must be Version 2.1.2 or later.

DB2 for Silicon Graphics IRIX is client-only. To run DB2 applications and applets, and to build DB2 embedded SQL applications and applets, you need to access a DB2 database on a server machine from your client machine. The server machine will be running a different operating system. See Quick Beginnings for UNIX for information on configuring client-to-server communication.

Also, since you will be accessing a database on the server from a remote client that is running on a different operating system, you need to bind the database utilities, including the DB2 CLI, to the database. See "Binding" for more information.

To run DB2 Java stored procedures or UDFs, you also need to update the DB2 database manager configuration on the server to include the path where the JDK is installed on that machine. You can do this by entering the following on the server command line:

   db2 update dbm cfg using JDK11_PATH /home/db2inst/jdk11

where /home/db2inst/jdk11 is the path where the JDK is installed.

You can check the DB2 database manager configuration to verify the correct value for the JDK11_PATH field by entering the following command on the server:

   db2 get dbm cfg

You may want to pipe the output to a file for easier viewing. The JDK11_PATH field appears near the beginning of the output. For more information on these commands, see the Command Reference.

To run Java programs on Silicon Graphics IRIX with DB2 JDBC support, the following environment variables are automatically updated during DB2 instance creation to ensure that:

To build SQLJ programs, CLASSPATH is also updated to include the file:

   sqllib/java/sqlj.zip

To run SQLJ programs, CLASSPATH is also updated to include the file:

   sqllib/java/runtime.zip

Solaris

To build Java applications on Solaris with DB2 JDBC support, you need to install and configure the following on your development machine:

  1. The Java Development Kit (JDK) Version 1.1.4 for Solaris, and the Solaris Native Thread pack, from Sun Microsystems (refer to http://www.software.ibm.com/data/db2/java).

  2. The DB2 Client Application Enabler for Solaris from the DB2 Client Pack. It must be Version 2.1.2 or later.

To run DB2 Java stored procedures or UDFs, you also need to update the DB2 database manager configuration on the server to include the path where the JDK is installed on that machine. You can do this by entering the following on the server command line:

   db2 update dbm cfg using JDK11_PATH /home/db2inst/jdk11

where /home/db2inst/jdk11 is the path where the JDK is installed.

You can check the DB2 database manager configuration to verify the correct value for the JDK11_PATH field by entering the following command on the server:

   db2 get dbm cfg

You may want to pipe the output to a file for easier viewing. The JDK11_PATH field appears near the beginning of the output. For more information on these commands, see the Command Reference.
Note:On Solaris, some Java Virtual Machine implementations do not work well in programs that run in a "setuid" environment. The shared library that contains the Java interpreter, libjava.so, may fail to load. As a workaround, you can create symbolic links for all needed JVM shared libraries in /usr/lib, with a command similar to the following (and depending on where Java is installed on your machine):
   ln -s /opt/jdk1.1.3/lib/sparc/native_threads/*.so /usr/lib
For more information on this and other workarounds available, please visit:
   http://www.software.ibm.com/data/db2/java/v5/faq.html

To run Java programs on Solaris with DB2 JDBC support, the following environment variables are automatically updated during DB2 instance creation to ensure that:

To build SQLJ programs, CLASSPATH is also updated to include the file:

   sqllib/java/sqlj.zip

To run SQLJ programs, CLASSPATH is also updated to include the file:

   sqllib/java/runtime.zip


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]