Install the postgres driver and look
into its service properties. You use these properties to build
osgi.jdbc.driver.name or osgi.jdbc.driver.class.
This will then use the plain DSF.
When you install the pool module it will create additional DSF
services. You can look into these properties to see how they look
like. You can then use these in the same way.
This works best in karaf as you have nice commands to look into
the services.
For example:
feature:repo-add pax-jdbc 0.8.0
feature:install pax-jdbc-postgresql
karaf@root()> service:list DataSourceFactory
[org.osgi.service.jdbc.DataSourceFactory]
-----------------------------------------
osgi.jdbc.driver.version = PostgreSQL 9.4 JDBC4.1 (build 1203)
osgi.jdbc.driver.class = org.postgresql.Driver
osgi.jdbc.driver.name = PostgreSQL JDBC Driver
service.id = 269
service.bundleid = 193
service.scope = singleton
Provided by :
PostgreSQL JDBC Driver JDBC41 (193)
This is the plain DSF.
You can address it using:
osgi.jdbc.driver.name=PostgreSQL JDBC Driver
or better
osgi.jdbc.driver.class = org.postgresql.Driver
When you now install_
feature:install pax-jdbc-pool-dbcp2
Then you have additional DSF services:
[org.osgi.service.jdbc.DataSourceFactory]
-----------------------------------------
pooled = true
osgi.jdbc.driver.class = org.postgresql.Driver-pool
osgi.jdbc.driver.version = PostgreSQL 9.4 JDBC4.1 (build 1203)
service.scope = singleton
osgi.jdbc.driver.name = PostgreSQL JDBC Driver-pool
service.bundleid = 197
service.id = 283
Provided by :
OPS4J Pax JDBC Pooling Support using Commons-DBCP2 (197)
[org.osgi.service.jdbc.DataSourceFactory]
-----------------------------------------
pooled = true
osgi.jdbc.driver.class = org.postgresql.Driver-pool-xa
osgi.jdbc.driver.version = PostgreSQL 9.4 JDBC4.1 (build 1203)
service.scope = singleton
osgi.jdbc.driver.name = PostgreSQL JDBC Driver-pool-xa
xa = true
service.bundleid = 197
service.id = 284
Provided by :
OPS4J Pax JDBC Pooling Support using Commons-DBCP2 (197)
You can address these again with their
driver.name and
driver.class properties.
So the easiest way is to simply look into your running system.
Christian