Download Lambda Probe now!
Download Lambda Probe instantly, no registration required. It is completely FREE!
 
Donate
Click here if you would like to donate to this project
 
Live demo
The latest version of Lambda Probe live in action! Site login: demo/demo

Oracle pool configuration in Tomcat

I've spent several hours "googling" for any information on how to configure Tomcat datasource that would be using Oracle pool implementation that comes along with the JDBC driver in ojdbc14.jar (classes12.jar). In the end I had to resort to means that I would rather not tell anyone about.

Anyway, here is a sample configuration that actually works:

        <Resource name="jdbc/orapool" auth="Container" type="oracle.jdbc.pool.OracleDataSource"
                  debug="0"/>
        <ResourceParams name="jdbc/orapool">
            <parameter>
                <name>factory</name>
                <value>oracle.jdbc.pool.OracleDataSourceFactory</value>
            </parameter>
            <parameter>
                <name>url</name>
                <value>jdbc:oracle:thin:@oracle-database-host:1521:ORCL</value>
            </parameter>
            <parameter>
                <name>connectionCachingEnabled</name>
                <value>true</value>
            </parameter>
            <parameter>
                <name>connectionCacheName</name>
                <value>dummy1</value>
            </parameter>
            <parameter>
                <name>connectionCacheProperties</name>
                <value>{MinLimit=0, MaxLimit=2, InitialLimit=0}</value>
            </parameter>
            <parameter>
                <name>user</name>
                <value>scott</value>
            </parameter>
            <parameter>
                <name>password</name>
                <value>tiger</value>
            </parameter>
        </ResourceParams>
    

There are several tricks you should know:

Despite this painful configuration procedure you should be rewarded in the end. Here are some benefits:

Unfortunately this is not a blog yet (I'm still working on it), but if you would like to comment on this how-to please send me a message and I will publish your comment here.

by Vlad Ilyushchenko, 30 January 2006