felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elMateo <soyelma...@gmail.com>
Subject Re: Connect a bundle to a data base
Date Wed, 21 Mar 2012 10:02:01 GMT
I'm working with the code of Neil and I have a problem: Felix show a
java.lang.ClassNotFoundException: javax.sql.DataSource not found

I import the javax.sql package in my manifest file but I don't know if I
need a bundle with this package in my Apache Felix. If I need a bundle with
this, what is this bundle? I don't find a bundle called javax.sql and I
have imported the MySQL connector/J bundle too.

On Tue, Mar 20, 2012 at 1:13 PM, Christian Schneider <
chris@die-schneider.net> wrote:

> Absolutely. That is what I wanted to say in my last post. The only problem
> with this aproach is that you hardcode the database type in your bridge
> bundle.
> ( At least if you dont want to mess with the classloader).
> As you probably will not have that many database types in one use case
> this is probably ok though.
> Christian
> Am 20.03.2012 11:27, schrieb Neil Bartlett:
>  You certainly don't need Glassfish... you don't need Karaf or Blueprint
>> either.
>> There is a tendency on many mailing lists to respond to beginner
>> questions with answers like "you can do this with product X" where X
>> happens to be the product that the person is working on or selling. Those
>> products may indeed add value but they are rarely the only or the simplest
>> way to achieve what you want!
>> To register a DataSource service with pure OSGi, it's as simple as
>> writing this code in a BundleActivator (using MySQL as an example):
>> DataSource ds = new com.mysql.jdbc.jdbc2.optional.**MysqlDataSource();
>> context.registerService(**DataSource.class.getName(), ds, null);
>> This would be your "bridge" bundle that you deploy alongside the MySQL
>> driver JAR. For other database types, write a different 2 lines of code and
>> deploy that bundle instead.
>> Kind regards,
>> Neil
> --
> 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<users-unsubscribe@felix.apache.org>
> For additional commands, e-mail: users-help@felix.apache.org

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message