If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-23-05, 14:17
jicr74 jicr74 is offline
Registered User
 
Join Date: Oct 2003
Posts: 21
java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver

Hi I'm developing a java project which has to do with a DB2 - JDBC connection seemingly the classpath is wreckin' it all since when launching:

Class.forName(driverName);

it throws
java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver exception

I 've set up the classpath which the way I assume it could be and no luck
The IDE I'm using is eclipse-myeclipse
and I just added db2java.zip to the build path
1)placed this ZIP in WEB-INF/lib project
2)added ZIP to classpath with add jars command

and it really shows as an added zip but I just can't get through.
db2java.zip is supposed to be 7.2 driver

any Idea?
Reply With Quote
  #2 (permalink)  
Old 11-23-05, 14:49
wangzhonnew wangzhonnew is offline
Registered User
 
Join Date: Nov 2005
Location: Toronto
Posts: 65
can you check the following?
LIBPATH should point to /sqllib/lib and
LD_LIB_PATH should point to /sqllib/lib.

and check if db2java.zip included in IBM/SQLLIB/JAVA
and make sure you only have 1 db2java.zip in your machine
__________________
IBM Certified DBA for DB2 UDB
IBM Certified Database Developer for DB2 UDB
DB2 Tech Support, IBM Toronto Software Lab

Last edited by wangzhonnew; 11-23-05 at 15:01.
Reply With Quote
  #3 (permalink)  
Old 11-23-05, 16:18
jicr74 jicr74 is offline
Registered User
 
Join Date: Oct 2003
Posts: 21
wangzhonnew
thanks for the quick reply.
forgive my ignorance should I check LIBPATH in the IDE or
in my server, either of the choice how can I do it?
Reply With Quote
  #4 (permalink)  
Old 11-23-05, 16:30
wangzhonnew wangzhonnew is offline
Registered User
 
Join Date: Nov 2005
Location: Toronto
Posts: 65
I guess it's IDE variable
__________________
IBM Certified DBA for DB2 UDB
IBM Certified Database Developer for DB2 UDB
DB2 Tech Support, IBM Toronto Software Lab
Reply With Quote
  #5 (permalink)  
Old 11-23-05, 16:40
jicr74 jicr74 is offline
Registered User
 
Join Date: Oct 2003
Posts: 21
Ok,
in the ide there ain't any LIBPATH variable nor LD_LIB_PATH
however I can set them , my only doubt is :
should they pont to the whole path
C:Program Files\SQLLIB\lib
or should this be a relative one?
SQLLIB/lib
and besides
there is no such a folder 'lib' in
C:Program Files\SQLLIB
however there is only one
db2java.zip
in C:Program Files\SQLLIB\JAVA
but several others in different folder eg:
C:Program Files\SQLLIB\java\java11
C:Program Files\SQLLIB\JAVA\java12
C:Program Files\SQLLIB\JAVA
...WEB-INF\lib (which is the one I added in my project)
Reply With Quote
  #6 (permalink)  
Old 11-23-05, 17:29
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by wangzhonnew
I guess it's IDE variable
I'm afraid your guess is incorrect. These are Unix environment variables. As we now know jicr74 runs his Eclipse on Windows, so this suggestion is not going to help.

Back to the original question, I suggest you check the properties of the server properties or the project run properties, depending on how you execute your application. I don't think that Windows CLASSPATH setting has any effect in this case.

I'd like to point out that the question belongs to an Eclipse support forum rather than a DB2 one since your problem is not specific to DB2.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On