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
On 21.06.2016 10:29, Michael Täschner wrote:
Hi Christian,
how is the postgres DSF referenced in the config ? Looking at my MySQL
config I use the "mysql" + "pool" --> "osgi.jdbc.driver.name
<http://osgi.jdbc.driver.name>=mysql-pool". How would this work for
postgres ?
Thanks and Best Regards,
Michael
2016-06-21 9:26 GMT+02:00 Christian Schneider <[email protected]
<mailto:[email protected]>>:
The native DSF of Postgres should work with the pax-jdbc pooling
and config modules out of the box.
Christian
On 21.06.2016 08 <tel:21.06.2016%2008>:54, Michael Täschner wrote:
Hi Christian,
just for clarification: this means there is no option to
configure PostGres datasources (and pooling) via PAX-JDBC? Do
you see a possibility to combine native DSF with PAX-JDBC
pooling and config ?
Thanks and Best Regards,
Michael
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
http://www.talend.com
--
--
------------------
OPS4J - http://www.ops4j.org - [email protected]
<mailto:[email protected]>
--- You received this message because you are subscribed to the
Google Groups "OPS4J" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to [email protected]
<mailto:ops4j%[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
--
------------------
OPS4J - http://www.ops4j.org - [email protected]
---
You received this message because you are subscribed to the Google
Groups "OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
http://www.talend.com
--
--
------------------
OPS4J - http://www.ops4j.org - [email protected]
---
You received this message because you are subscribed to the Google Groups "OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.