Bug 18539 - unable to run JDBC program, class not found
Summary: unable to run JDBC program, class not found
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 blocker (vote)
Target Milestone: 2.0 F3   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-31 18:56 EDT by Fai Chew CLA
Modified: 2002-06-05 07:23 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.