Linux

advertisement
Linux
To build Java applications on Linux with DB2 JDBC support, you need to install and
configure the following on your development machine:
1. Java Development Kit (JDK) 1.1.7, Version 1a or later for Linux from the
Blackdown Organization. (see http://www.software.ibm.com/data/db2/java
).
2. DB2 Java Enablement, provided on DB2 Universal Database Version 6.1 for
Linux clients and servers. For DB2 for Linux Version 5.2 (beta), this support has
been provided with the DB2 Client Application Enabler for Linux, Version 5.2.
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 redirect 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 Linux, the Java Virtual Machine implementation does 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 a
symbolic link to the JVM shared library in /usr/lib, with a command similar to
the following (depending on where Java is installed on your machine):
ln -s /usr/local/jdk117_v1a/lib/i686/native_threads/libjava.so
/usr/lib
For more information on this and other workarounds available, please visit:
http://www.software.ibm.com/data/db2/java/faq.html
To run JDBC and SQLJ programs on Linux with DB2 JDBC support, commands to
update your Linux Java environment are included in the database manager files
db2profile and db2cshrc. When a DB2 instance is created, .bashrc, .profile, and/or
.cshrc are modified so that:
1. THREADS_FLAG is set to "native".
2. CLASSPATH includes:
o "." (the current directory)
o the file sqllib/java/db2java.zip
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
Download