blob: 7682539ee019753ec8e1a55876f6861671308e19 [file] [log] [blame]
<!--
Sample JOCL configuration file for JOCLPoolingDriverExample.java.
It's not pretty, but it works. It will be replaced by Digester-based
configuration as soon as it's available.
See the JavaDocs for org.apache.commons.jocl.JOCLContentHandler for
documentation on JOCL in general. The gist of it is an that it provides
an XML description of a constructor to be invoked.
See the JavaDocs for PoolableConnectionFactory et al for details
on the object we are constructing. The inline comments may help as well.
To use this with the JOCLPoolingDriverExample, make a copy of this
file called it "poolingDriverExample.jocl", set the connection string below
(search for "CHANGE ME"), and make sure the poolingDriverExample.jocl file
is available in your classpath. (See JOCLPoolingDriverExample.java.)
-->
<!--
The PoolingDriver expects PoolableConnectionFactory to be the root of the JOCL document.
-->
<object class="org.apache.commons.dbcp.PoolableConnectionFactory" xmlns="http://apache.org/xml/xmlns/jakarta/commons/jocl">
<!--
The first argument to PoolableConnectionFactory is a ConnectionFactory.
We'll use a DriverManagerConnectionFactory, passing in the appropriate
connect string for the underlying driver.
-->
<object class="org.apache.commons.dbcp.DriverManagerConnectionFactory">
<string value="jdbc:oracle:thin:scott/tiger@myhost:1521:mysid"/> <!-- CHANGE ME TO THE CONNECT STRING FOR YOUR DRIVER -->
<object class="java.util.Properties" null="true"/>
</object>
<!--
The next argument is the pool to use. We'll use a StackObjectPool,
although any implementation of ObjectPool should suffice.
-->
<object class="org.apache.commons.pool.impl.StackObjectPool"/>
<!--
The next argument is the KeyedObjectPoolFactory to use to create pools
for storing PreparedStatements. This functionality is optional, we'll
just use null.
-->
<object class="org.apache.commons.pool.KeyedObjectPoolFactory" null="true"/>
<!--
The next argument is the query to use to validate that a Connection is
still up and running. It should return at least one row.
This functionality is optional. We'll just set it to null.
-->
<string null="true"/>
<!-- The default "read only" value for Connections. -->
<boolean value="false"/>
<!-- The default "auto commit" value for Connections. -->
<boolean value="true"/>
</object>