[jboss-user] [JBoss Tools] - Driver Definition/JDBC driver

Brian Fitzpatrick do-not-reply at jboss.com
Tue Jul 13 16:50:07 EDT 2010


Brian Fitzpatrick [http://community.jboss.org/people/bfitzpat] replied to the discussion

"Driver Definition/JDBC driver"

To view the discussion, visit: http://community.jboss.org/message/552406#552406

--------------------------------------------------------------
That's certainly part of the equation - making sure that the driver jar is available on the Eclipse classpath.

But there's another step... Once you have your jar wrapped in a plug-in, you have to tell the driver template where to find it. You can do that with a driver template override...

For example, if I've exposed my derby.jar for a Derby database JDBC driver in plug-in org.eclipse.datatools.derby.wrapper... I can override the jar list of that driver so that it automatically picks it up.

<plugin>
   <extension
         point="org.eclipse.datatools.connectivity.driverExtension">
      <driverTemplateOverride
            jarList="[org.eclipse.datatools.derby.wrapper]/lib/derby.jar"
            priority="1"
            targetId="org.eclipse.datatools.connectivity.db.derby102.genericDriverTemplate">
      </driverTemplateOverride>
          </extension>
</plugin>

If you want it to automatically add the driver instance the first time the DriverManager is fired up (i.e. whenever you fire up the Data Source Explorer it'll check to see if the default driver instance has been created), you just add createDefault = true like this:

<extension
         point="org.eclipse.datatools.connectivity.driverExtension">
      <driverTemplateOverride
            createDefault="true"
            jarList="[org.eclipse.datatools.derby.wrapper]/lib/derby.jar"
            priority="1"
            targetId="org.eclipse.datatools.connectivity.db.derby102.genericDriverTemplate">
      </driverTemplateOverride>
   </extension>

Hope that helps!

--Fitz

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/552406#552406]

Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100713/0a323337/attachment.html 


More information about the jboss-user mailing list