File: poolingDriverExample.jocl.sample

package info (click to toggle)
libcommons-dbcp-java 1.4-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,952 kB
  • sloc: java: 16,699; xml: 2,245; jsp: 84; sh: 12; makefile: 2
file content (70 lines) | stat: -rw-r--r-- 3,255 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<!--
 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>