PDA

View Full Version : Datasource drivers when no OSGI bundle available



Beta User
Jul 2nd, 2008, 04:18 AM
At the moment we use JNDI datasources with a fall back to a DBCP one if no JNDI one is avaialble. As S2AP does not have JNDI, my understanding is we deploy a datasource configuration as a bundle which is fine. The question is, what happens if your bundle relies on a JDBC driver that is not yet OSGIified (sic) and in the SpringSource Repository ?

Should the driver be shipped in the datasource bundle, or is it relatively easy to make a bundle out of a jdbc driver ?

Dave Syer
Jul 2nd, 2008, 08:44 AM
How easy it is to OSGisfy a JDBC driver jar depends on the driver implementation internals a bit. You can automate it with some effort using bnd, but that isn't always perfect. If you need something fast I would just hack one together and see if it works until one can be found from an "official" source (probably it will have a similar structure to one of the existing driver bundles - imports javax.sql etc and exports its own driver class). Also I would raise an issue in the BRITS jira (but you knew that). Which driver do you need?

Beta User
Jul 2nd, 2008, 08:59 AM
Hi Dave

I've raised a BRITS Jira for this already http://static.springsource.com/projects/sts-ap/update/

Unfortuantely the driver is for DB2 on the iSeries aka AS400 aka IBM i.

The good news is that the driver is completely open source, the bad news is that is a driver for a whole load of functionality other than just jdbc (it allows you to call a whole host of native functions on an AS400 via the driver).

I have no immediate need for this but it will be a bit of a blocker later on. I guess I could just chuck the jar in WEB-INF/lib, but that would defy the whole point of the exercise :-)

Beta User
Jul 2nd, 2008, 09:06 AM
I'll have a go doing myself based on this blog entry:

http://swik.net/Spring/Interface21+Team+Blog/Creating+OSGi+bundles/b2yoy