Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dtp-dev] jdbc driver packaged as plugin

Hey Anthos,

>
> but when I try ping the db connection () it is resulting
>
> java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
>
> Any thoughts ?
>

This is because the driver definition creates a classloader using the
defined JAR files as the classpath (i.e. the plugin classloaders are not
used).

You have two options here:
1.  Do not use the driver framework.  Create a custom wizard for your DB.
Make sure you populate the fields required by the ConnectionInfo connection
factory (IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID and
DATABASE_VERSION_PROP_ID).  Create a custom connection factory for
java.sql.Connection.  You will have direct control over how the connection
is created and can make use of the plugin classloader.  (Note, this
approach will require that the driver is distributed with your plugin.)

2.  You can reference the classpath created by the driver definition when
creating your connection.  (Note, you can define the location of the jar
using a plugin relative location.  I'm not exactly sure what the syntax is
for that in your driver definition.)

Hope that helps.
Rob



Back to the top