Connecting Tech Pros Worldwide Forums | Help | Site Map

Cannot load driver while using jdbc in eclipse plugin

Newbie
 
Join Date: May 2007
Posts: 2
#1: May 23 '07
Hi,

I am trying to write my first eclipse plugin and am accessing a DB2 db from within the plugin. I added the db2java.zip file in the Libraries for the java build path for this plugin. But when this statement is executed, it gives me a ClassNotFoundException.

Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");

The code is working just fine when I run it from outside the plugin, it does not give any exception and the DB access is working fine.

What do I do?
Neha.

Newbie
 
Join Date: May 2007
Posts: 2
#2: May 23 '07

re: Cannot load driver while using jdbc in eclipse plugin


I solved the problem.

Apparently, you have to unzip the db2java folder and add it in the plugin/lib folder and then add the name of the unzipped folder into Runtime > Classpath in the plug in.

Neha.
Reply