Solved

DB2 driver exception

Posted on 2004-04-23
14
331 Views
Last Modified: 2010-03-31
I am getting this exception.

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


I have made sure that the db2jcc.jar is in ClassPath, but I am still getting the exception. ANy help is really appreciated.
0
Comment
Question by:dkathuria
  • 5
  • 4
  • 2
  • +1
14 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 10904624
You'll probably find that nonetheless is is NOT in your classpath. Put the jar in jre/lib/ext directory of your runtime and you won't need to worry about the classpath
0
 
LVL 92

Expert Comment

by:objects
ID: 10904845
what are u running when u get the exception?
If its a container such as tomcat then put your jar in <webapp>/WEB-INF/lib
0
 
LVL 92

Expert Comment

by:objects
ID: 10904848
And make sure yu have specified the correct classname.
Perhaps it should be:

com.ibm.db2.jdbc.net.DB2Driver
0
 

Author Comment

by:dkathuria
ID: 10904889
Tried as you said, but still no luck
0
 
LVL 92

Expert Comment

by:objects
ID: 10904940
so what exactly are you running when u get the exception?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10904959
Are you sure that class is in that jar? List it to find out:

jar tvf db2jcc.jar
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:dkathuria
ID: 10905225
I could n't find COM.ibm.db2.jdbc.net.DB2Driver in db2jcc.jar. But I thought thats where this driver supposed to be. Any idea in which package this driver foing to be in?

Thanks
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10905242
That's the reason for the error then. Not sure about that db. All i can suggest is looking in all the jars that come with the db or are associated with it
0
 
LVL 92

Accepted Solution

by:
objects earned 38 total points
ID: 10905283
how exactly are you using it?
this may help you:
http://www-306.ibm.com/software/data/pubs/papers/sqlj/
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 37 total points
ID: 10905340
Be careful when you're checking that jar. This Java example (towards the bottom) suggests the driver *is* in that jar:

http://www-106.ibm.com/developerworks/db2/library/techarticle/dm-0401chong/index.html
0
 

Expert Comment

by:btobin1
ID: 10907071
Actually the link given by CEHJ says that the driver is NOT in db2jcc.jar, but rather:

The DB2 UDB type 3 driver is stored in file db2java.zip under sqllib\java (the same file as for the type 2 App driver)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10907098
Depends what driver we're talking about:

>>
The DB2 type 2 Universal driver is stored in file db2jcc.jar under sqllib\java


The DB2 type 4 Universal driver is stored in file db2jcc.jar under sqllib\java (This Universal Driver implements Type 2 and Type 4 drivers). Type 4 only works with the TCP/IP protocol


The DB2 type 2 App driver is stored in file db2java.zip under sqllib\java
>>

To cover all bases, rename db2java.zip (if you have that file) to db2java.jar and place it in the ext directory where i mentioned before
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now