Setting up IBM DB2 Connect with JDBC.
Purpose
To connect to a DB2 Connect server which subsequently connects to the DB2 Database using JDBC.
Prerequisites
- A working runtime client installed on your machine.
- Make sure you have the environment variables set per runtime client.
- A project that has a JDBC Java class:
- Classpath set up properly (see below).
Setting Your Class Path
The following files need to be in your classpath
(This section assumes your db2 instance is /home/db2inst1) and you have set your environment variables appropriately either locally or in eclipse.
- /home/db2inst1/sqllib/java/db2java.zip
- /home/db2inst1/sqllib/java/db2jcc.jar
- /home/db2inst1/sqllib/java/db2jcc_javax.jar
- /home/db2inst1/sqllib/java/db2jcc_license_cu.jar
- $ist-jxde/lib/db2jcc_license_cisuz.jar (wherever ist-jxde is checked out)
Compile and Run!
- Compile: javac className.java
- Run: java className


