I just checked the mysql driver. It does not support a DataSourceFactory itself. So you will need the adapter from pax jdbc.

You can simply check how pax-jdbc-config does it.
See
https://github.com/ops4j/org.ops4j.pax.jdbc/blob/master/pax-jdbc-config/src/main/java/org/ops4j/pax/jdbc/config/impl/DataSourceFactoryTracker.java
https://github.com/ops4j/org.ops4j.pax.jdbc/blob/master/pax-jdbc-config/src/main/java/org/ops4j/pax/jdbc/config/impl/DataSourceRegistration.java

The most complicated part in pax-jdbc-config is tracking the TransactionManager, PooledDataSourceFactory and DataSourceFactory. As you do not have to make your code universal you can make this easier by using DS and just injecting the named services you need.

If you need it universal then the fastest way is to just copy and change pax-jdbc-config.

Christian

On 08.01.2017 18:49, GOGLE YOTUBE wrote:
Thank you, Christian! This was very helpful...
If I could ask something else: are you aware of any example programmatic creation of the data source you can point me to? We have our own library of credential resolution, and I'd like, instead of providing the 'user' and 'password' properties, to provide a 'key' property from which I first can resolve a user name a password using our credential library. Then, with the resolved user and password, I can create the data source programatically.

Thanks again!

On Friday, 6 January 2017 02:06:55 UTC-5, Christian Schneider wrote:

    Pax-jdbc 0.10 changes the way the pooling is implemented. It is
    documented here:
    https://ops4j1.jira.com/wiki/display/PAXJDBC/Pooling+and+XA+support+in+1.0.0
    
<https://ops4j1.jira.com/wiki/display/PAXJDBC/Pooling+and+XA+support+in+1.0.0>

    The idea was to release this as 1.0.0. This is why the doc already
    references this version.

    Christian

    2017-01-05 20:54 GMT+01:00 GOGLE YOTUBE <medal...@gmail.com
    <javascript:>>:

        Hi,

        In Karaf 4.0.8, I did the following feature install:

        /*feature:install transaction jndi
        pax-jdbc-h2/0.10.0.SNAPSHOTpax-jdbc-config/0.10.0.SNAPSHOT 
pax-jdbc-pool-dbcp2/0.10.0.SNAPSHOT*/

        A 'service:list DataSourceFactory' shows the H2 service but
        not the pooled/XA version of it. I have the same problem when
        I also install 'pax-jdbc-pool-aries' feature.

        The reason I want 0.10.0.SNAPSHOT is that I need to use the
        JTDS drivers for some of my SQL Server connections.

        What I tried next is to uninstall version 0.10.0.SNAPSHOT of
        the pax-jdbc features and install version 0.9.0 instead. The
        pooled/AX services now show up for H2. Next, I installed
         pax-jdbc-jtds version 0.10.0.SNAPSHOT (version 0.9.0 does not
        exist). I also got the pooled/XA services for jtds this way.
        However, I have these 2 features started:
        pax-jdbc-spec 0.10.0.SNAPSHO
        pax-jdbc-spec 0.9.0

        I am not sure whether my solution is ok and whether there
        would be a problem having different version of pax-jdbc-spec
        running.

        Any suggestions?

        Thanks!!
-- -- ------------------
        OPS4J - http://www.ops4j.org - op...@googlegroups.com
        <javascript:>

        ---
        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 ops4j+un...@googlegroups.com <javascript:>.
        For more options, visit https://groups.google.com/d/optout
        <https://groups.google.com/d/optout>.




-- -- Christian Schneider
    http://www.liquid-reality.de
    
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>

    Open Source Architect
    http://www.talend.com
    
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>

--
--
------------------
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

---
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 ops4j+unsubscr...@googlegroups.com <mailto:ops4j+unsubscr...@googlegroups.com>.
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 - ops4j@googlegroups.com

--- 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 ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to