Bug 18539

Summary: unable to run JDBC program, class not found
Product: [Eclipse Project] JDT Reporter: Fai Chew <sfcfai>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED WORKSFORME QA Contact:
Severity: blocker    
Priority: P2    
Version: 2.0   
Target Milestone: 2.0 F3   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Fai Chew CLA 2002-05-31 18:56:10 EDT
when the following statement is executed, an java exception occurs
 Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");

java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver

In preferences, I created classpath variable as follows:
db2a - C:/SQLLIB/java/db2java.zip

This zip file contains the class that cannot be found so I should not be 
getting this error.
Comment 1 Philipe Mulet CLA 2002-06-01 04:18:06 EDT
Does it work better if you compiler and run with another compiler/vm (outside 
Eclipse) ?
Comment 2 Philipe Mulet CLA 2002-06-01 06:59:18 EDT
Actually the exact questions are:

1. does it work better if compiling the files with javac ?
2. does it work better if running the (Eclipse) files with java (using manual 
console launch).
Comment 3 John Wiegand CLA 2002-06-01 15:17:14 EDT
0601.

This works fine for me (My db2java.zip is dated 2/22/02 so it likely older than 
yours)

Did you add the variable to your build path?  Defining the variable in the 
preferences does not add it to your project.

Note: you no longer need to go to preferences at all - you can just add a 
variable to your classpath in the java build path page (either during project 
creation or by selecting project properties to do it later).

Items on your buildpath are automatically added to your runtime classpath. You 
can explicitly add variables to your runtime classpath in the Launch 
Configuration Wizard.
Comment 4 Philipe Mulet CLA 2002-06-05 07:23:07 EDT
Closing, please reopen if you can still make the problem occur given the 
recommandations.