Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get DB2 Sample Java Application to Work

Status
Not open for further replies.

elfinlaley

Programmer
May 2, 2001
3
0
0
US
Hi,

The code below is from the DB2 Java samples, and it is blowing up on the Class.forName("COM.ibm.... line. The package directory does not exist. Does anyone have a real life example of how this line should appear? I have the DB2 Enterprise version 7 installed on my Win2k box.

Thanks

class DB2Appl {

static {
try {
// register the driver with DriverManager

Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
} catch (Exception e) {
e.printStackTrace();
}
}
 
Hi,

Solved my own problem after a pointer from a fellow programmer. With Win2k (as NT), you need the classpath for your User variables to include d:\sqllib\java\db2java.zip. This was already in the System environment variable. When I put the path in the User environment variable for the classpath, I was able to compile and get a result set.

Have a great day
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top