cschneider wrote
> You showed how you get the DataSource from jndi but not how you created
> it.
> Do you use a pax-jdbc config for this?
> 
> Christian

The datasource feature is build with maven and based on a blueprint file.
The config parts that seem relevant are below. (I didn't work on this
project when the datasource was created and don't know exactly why it was
done this way.)

So the datasource class is org.apache.commons.dbcp.BasicDataSource and
needed is OracleDataSource which is only the driverClassName property. I'm
not sure how to fix this.
Can the BasicDataSource give me somehow an OracleDataSource?
Should I change the bean class in the blueprint to OracleDataSource? (Would
probable require changing a lot of config properties and it would loose
special capabilities that the BasicDataSource has.)
Or do I have to create a datasource by other means? (I'm not sure how
pax-jdbc works.)

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
        xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0";
        xmlns:enc="http://karaf.apache.org/xmlns/jasypt/v1.0.0";>
        
        <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
                destroy-method="close">
                <property name="driverClassName" 
value="oracle.jdbc.pool.OracleDataSource"
/>              
                        ...
        </bean>

        <service interface="javax.sql.DataSource" ref="dataSource">
                <service-properties>
                        <entry key="de.foo.datasource.name" 
value="ds-oracle-av" />
                        <entry key="osgi.jndi.service.name" value="jdbc/av-ds" 
/>
                </service-properties>
        </service>
</blueprint>





--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Reply via email to