25 June 2012

Pax JDBC: An OSGi JDBC Service

Pax JDBC is a new project under the OPS4J umbrella which simplifies the use of JDBC drivers in OSGi applications by providing a generic driver extender and various native driver adapters for your favourite database.

This project aims at compliance with the OSGi Enterprise Release 5.0 specification.

Pax JDBC 0.1.0 is available from Maven Central, with native adapters for Apache Derby and PostgreSQL. Since this first release, support for H2 and MySQL has been added, and further contributions are always welcome.

4 comments:

tokra said...

Hi,
Could you please post any example how to use PAX JDBC with OSGi Equinox & JPA Eclipselink + Mysql ?

Harald Wellmann said...

For Equinox + MySQL + Pax JDBC, see this integration test:

https://github.com/ops4j/org.ops4j.pax.jdbc/blob/jdbc-0.2.0/pax-jdbc-itest/src/test/java/org/ops4j/pax/jdbc/test/mysql/MysqlNativeDataSourceTest.java

For Eclipselink, there is an integration test in Pax JPA that might help:

https://github.com/ops4j/org.ops4j.pax.jpa/blob/master/pax-jpa-itest/src/test/java/org/ops4j/pax/jpa/test/EclipselinkTest.java

Warning: Pax JPA is alpha!

Peter Kriens said...

Will you be actively maintaining this project. I saw that recent MySQL drivers are now OSGi wrapped so it should become easier.

Harald Wellmann said...

@Peter: Thanks, I hadn't noticed.

I've updated MySQL and all other driver versions for 0.3.0-SNAPSHOT, but this only affects the tests and not the adapter implementations.

Anyway, there's a whole lot of dependency upgrades, so I'm going to build a Pax JDBC 0.3.0 release soon.