Sachin Handiekar

Sachin Handiekar


August 2013
M T W T F S S
« Jan   Feb »
 1234
567891011
12131415161718
19202122232425
262728293031  

Categories


Oracle Datasource in Fuse ESB / Apache Karaf

Sachin HandiekarSachin Handiekar
Creating a Oracle data-source in Fuse ESB [Apache Karaf]



1. Create a blueprint xml file as shown below –



datasource-oracle.xml



2. Installing the Oracle Driver in Karaf console

install -s wrap:mvn:com.oracle/ojdbc6/11.2.0

Note: Please make sure you’ve got the Oracle Driver in your local/remote maven repository. If you don’t have it please install with the following maven command –

mvn install:install-file -Dfile=ojdbc6.jar -DgroupId=com.oracle 
    -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar

2. Deploy it on the Fuse ESB server

Copy the datasource-oracle.xml in the FUSE ESB deploy folder ( e.g. %FUSE_SERVER%/deploy )

Comments 1
  • Valery D
    Posted on

    Valery D Valery D

    Reply Author

    Optionally, you can add configure a pool of connections

    <?xml version="1.0" encoding="UTF-8"?>
    <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"&gt;

    <bean id="dataSource" class="oracle.jdbc.pool.OracleDataSource">
    <property name="URL" value="jdbc:oracle:thin:@[hostname]:[port]/[service-name]"/>
    <property name="user" value="username"/>
    <property name="password" value="password"/>
    <property name="connectionCachingEnabled" value="true"/>
    <property name="connectionCacheProperties">
    <props>
    <prop key="InitialLimit">2</prop>
    <prop key="MinLimit">2</prop>
    <prop key="MaxStatementsLimit">10</prop>
    </props>
    </property>
    </bean>

    <service interface="javax.sql.DataSource" ref="dataSource">
    <service-properties>
    <entry key="osgi.jndi.service.name" value="jdbc/oracleds"/>
    <entry key="datasource.name" value="OracleDS"/>
    </service-properties>
    </service>
    </blueprint>

    The available pool properties you can learn in javadoc oracle.jdbc.pool.OracleDataSource

    The MaxStatementsLimit(default equal 0) is an important property, it allows parsing to prevent repeated queries.


Leave a Reply