How bundle database drivers and expose a connection pool? [message #721226] |
Thu, 01 September 2011 08:23 |
Paul Ramsden Messages: 84 Registered: February 2011 Location: BW, Germany |
Member |
|
|
I guess is really more of an OSGi question, but as I'm working on a RAP project I'll ask it here first.
I want to connect to DB2 and MS-SQL databases from my application and connection pooling should also be enabled. Also, I want to be able to configure the connections depending on the current environment - Test, Staging, Production.
I assume the way to do this is to define a separate plugin for each database which contains either the necessary jars or a link to the jars location. This plugin will export the API package. A further plugin imports the API packages and create the connection pools and handle connection requests from application plugins.
Is this a good approach? Are there any working examples out there as, so far, I have not been able to get it to work? (the problem seems to be with the export of the JDBC package)
Thanks
Paul
[Updated on: Mon, 05 September 2011 06:57] Report message to a moderator
|
|
|
(no subject) [message #724503 is a reply to message #721226] |
Mon, 12 September 2011 13:30 |
Eclipse User |
|
|
|
Originally posted by:
Paul,
as you said, this question is better homed in an OSGi forum. But I think
you are on the right track.
First you will have to 'bundelize' the database driver. Next is to
configure the pool. I would opt for a pooling library that allows you to
provide your own code to actually create the connection or at least
specify the driver as a class (as opposed to a string). This will save
you from the usual class loading trouble.
HTH
Rüdiger
On 01.09.2011 10:23, Paul Ramsden wrote:
> I guess is really more of an OSGi question, but as I'm working on a RAP
> project I'll ask it here first.
>
> I want to connect to DB2 and MS-SQL databases from my application and
> connection pooling should also be enabled. Also, I want to be able to
> configure the connections depending on the current environment - Test,
> Staging, Production.
>
> I assume the way to do this is to define a separate plugin for each
> database which contains either the necessary jars or a link to the jars
> location. The plugin will create the connection pool and handle
> connection requests from other plugins.
>
> Is this a good approach? Are there any working examples out there as, so
> far, I have not been able to get it to work? (the problem seems to be
> with the export of the JDBC package)
>
> Thanks
> Paul
--
Rüdiger Herrmann
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
Powered by
FUDForum. Page generated in 0.02791 seconds