Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 340
  • Last Modified:

DB2 driver exception

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
dkathuria
Asked:
dkathuria
  • 5
  • 4
  • 2
  • +1
2 Solutions
 
CEHJCommented:
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
 
objectsCommented:
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
 
objectsCommented:
And make sure yu have specified the correct classname.
Perhaps it should be:

com.ibm.db2.jdbc.net.DB2Driver
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
dkathuriaAuthor Commented:
Tried as you said, but still no luck
0
 
objectsCommented:
so what exactly are you running when u get the exception?
0
 
CEHJCommented:
Are you sure that class is in that jar? List it to find out:

jar tvf db2jcc.jar
0
 
dkathuriaAuthor Commented:
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
 
CEHJCommented:
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
 
objectsCommented:
how exactly are you using it?
this may help you:
http://www-306.ibm.com/software/data/pubs/papers/sqlj/
0
 
CEHJCommented:
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
 
btobin1Commented:
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
 
CEHJCommented:
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now