You could create one bundle per datasource. Inside you would use maven
to embed the mysql driver you need.
Using the config admin service you could externalize the db details like
url, user, password.
It would lack the simplicity of the standalone blueprints but should work.
If you want to go the factory way you could define your own factory
interface for now and then create one bundle per driver. Later you then
can switch to the osgi jdbc spec.
Perhaps you could even define the interface according to the spec so you
would not have to change your clients later.
Christian
Am 14.08.2012 06:01, schrieb Gareth:
Hi Christian,
I saw that. It sort of doesn't meet my needs because I can't just do
something like this:
<bean id="dataSource"
class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource">
<property name="url" value="jdbc:mysql://localhost:3306/world"/>
<property name="user" value="test"/>
<property name="password" value="test"/>
</bean>
as I am required to have multiple versions of
com.mysql.jdbc.jdbc2.optional.MysqlDataSource accessible (I need to install
multiple mysql drivers to communicate with multiple mysql versions).
Instead, rather than making the JDBC drivers stand-alone bundles, I am
wrapping my JDBC drivers in DataSourceFactories which allow me to choose the
correct data source factory via OSGi service parameters (which also means
the mapping JDBC URL to JDBC data source is configurable rather than being
defined by import-package).
Gareth
--
View this message in context:
http://karaf.922171.n3.nabble.com/org-osgi-service-jdbc-and-Karaf-tp4025573p4025580.html
Sent from the Karaf - User mailing list archive at Nabble.com.
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
Talend Application Integration Division http://www.talend.com