Gemini JPA / DBAccess - best way to configure JDBC properties? [message #1002312] |
Fri, 18 January 2013 06:36  |
Eclipse User |
|
|
|
I've just migrated an OSGi application to Gemini JPA / DBAccess with MySQL, running on Virgo 3.6. Currently I have the jdbc connection property values set in the persistence.xml file. Is it possible to store these properties in a separate configuration file? I'd like to change files for different environments e.g. development, production.
Previously, I had my own OSGi bundle which created a datasource using a C3P0 connection pool. This used a property-placeholder bean which referenced a configuration artefact loaded by Virgo:
<!-- Create a connection pool data source (using C3P0 lib) for the DB -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
p:driverClass="${db.driverClass}"
p:jdbcUrl="${db.url}"
p:user="${db.username}"
p:password="${db.password}"
/>
<context:property-placeholder properties-ref="configProperties"/>
<osgi-compendium:cm-properties id="configProperties" persistent-id="db_config"/>
<!-- ========================= OSGi SERVICES ========================= -->
<osgi:service ref="dataSource" interface="javax.sql.DataSource"/>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04843 seconds