try {
Class.forName("com.ibm.db2.jcc.DB2Driver");
} catch (ClassNotFoundException e) {
Activator.logError("getConnection", e);
throw e;
}
return DriverManager.getConnection("jdbc:db2://servername", "user", "pwd");
This did not work. Eclipse plug-ins have their own class loader and the DB2 jar must be added to the plug-in classpath.
Open the plugin.xml and select the 'Runtime' tab. In the 'Classpath' section select 'Add...' and choose the DB2.jar (and any other JARs which are needed).
Best practice (I would guess) would be to have separate plug-ins for each external library (log4j, db2 etc).
No comments:
Post a Comment