felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <ch...@die-schneider.net>
Subject Re: Connect a bundle to a data base
Date Wed, 21 Mar 2012 16:17:44 GMT
I also wondered if I should start writing something like this. The 
problem is that DataSources and in the same way jms ConnectionFactories 
are configured
very differently. It is not only a url and usernam, password in some 
cases. So this can be quite complicated.

I found a very elegant solution using blueprint and the karaf blueprint 
deployer though. You can define the DataSource bean in the blueprint 
file and export it as a service.
Blueprint is flexible enough so you can define almost any DataSource 
like this. The Karaf blueprint deployer then uses bnd to create the 
necessary package imports on the fly.
It is even possible to externalize username / password with the config 
admin service but as the blueprint file can be changed on the fly and is 
small I did not even do that.

I have put some examples on github:
https://github.com/cschneider/Karaf-Tutorial/tree/master/db/datasource

This solution is extremly simple and I think good enough for most 
situations. So while it would be nice to have a service like you 
described I did not really miss it till now.

Christian

Am 21.03.2012 14:38, schrieb Donald Whytock:
> What you probably want in the long run is a datasource-generating
> service, to which you pass the database URI.  You can put things in
> the properties of the service to indicate whether it's Oracle, mySQL,
> MSSQL, etc., so that you can have multiple generating services at the
> same time.
>
> Don
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


-- 

Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message