DB2 Version 9.7 for Linux, UNIX, and Windows

Building JDBC applications

You can use a Java™ makefile or manually execute the javac command to build JDBC applications.

The following steps demonstrate how to build and run the DbInfo sample JDBC application.
  1. Compile DbInfo.java to produce the file DbInfo.class with this command:
       javac DbInfo.java
  2. If you are running a Java application on UNIX in a 64-bit DB2 instance but the software development kit for Java is 32-bit, you need to change the DB2 library path before running the application. For example, on AIX®:
    • If using bash or Korn shell:
         export LIBPATH=$HOME/sqllib/lib32
    • If using C shell:
         setenv LIBPATH $HOME/sqllib/lib32
  3. Run the Java interpreter on the application with this command:
       java DbInfo