File: configure.html

package info (click to toggle)
libproxool-java 0.9.0~rc3-2
  • links: PTS, VCS
  • area: contrib
  • in suites: lenny
  • size: 2,416 kB
  • ctags: 2,446
  • sloc: java: 13,891; xml: 802; makefile: 12; sh: 10
file content (343 lines) | stat: -rw-r--r-- 14,374 bytes parent folder | download
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343






<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">





<html>
  <head>
    <meta http-equiv="Content-Language" content="en-gb">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta http-equiv="Expires" content="-1">
    <meta http-equiv="Pragma" content="no-cache">
    <title>Proxool 0.9.0RC3</title>
    <link href="proxool.css" type="text/css" rel="stylesheet">
  </head>

  <body>

 <div style="max-width: 1200px;">
    <table border="0" style="min-height: 100%;" cellpadding="0" cellspacing="0" width="100%">
      <tbody>

        <tr>
          <td valign="bottom" width="150">
            &nbsp;
          </td>

          <td colspan="2" height="50">
            
              <div class="bannerFinal">
            
            
            <table cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                  <td height="50">
                    <span class="titleCaption" style="font-size: 110%; padding: 4px;">
                        Configuration
                    </span>
                    
                  </td>
                  <td valign="middle" height="50">
                    <div>
                      

<div style="float: right; margin-right: 8px;">
    <img src="images/dots.gif" width="80" height="20" border="0" alt="...">

    <a href="http://sourceforge.net/projects/proxool"><img src="images/sflogo.png" width="88" height="31" border="0" alt="SourceForge.net Logo"></a>

</div>

                    </div>
                  </td>
                </tr>
            </table>
            </div>
          <td width="10">&nbsp;</td>
        </tr>

        <tr>
          <td valign="top" width="150">
            &nbsp;<br/>
            &nbsp;<br/>
            <table
              cellpadding="0"
              cellspacing="0"
              border="0"
              width="100%"
            >
              <tbody>

                <tr>
                  <td valign="top">
                    
                    
                    
                    
                    



<div class="menuBox" >
    <div class="menu-inactive"><a class="menu-inactive" href="index.html">Home</a></div>
    <div class="menu-inactive"><a class="menu-inactive" href="news.html">News</a></div>
    <div class="menu-inactive"><a class="menu-inactive" href="faq.html">FAQ</a></div>
    <div class="menu-inactive"><a class="menu-inactive" href="tips.html">Tips</a></div>
    <div class="menu-inactive"><a class="menu-inactive" href="changelog.html">Changes</a></div>
    <div class="menu-inactive"><a class="menu-inactive" href="future.html">The Future</a></div>
    
    <div class="menu-active"><a class="menu-active" href="user.html">User&nbsp;Guide</a></div>
    
        <div class="menu-inactive"><a class="menu-inactive" href="dev.html">Developer&nbsp;Guide</a></div>
    
    <div class="menu-inactive"><a class="menu-inactive" href="licence.html">Licence</a></div>
    <div class="menu-inactive"><a class="menu-inactive" href="credits.html">Credits</a></div>
    <div class="menu-separater">User Guide:</div>
    <div style="margin-left: 8px">
        <div class="menu-inactive"><a class="menu-inactive" href="user.html">Introduction</a></div>
        <div class="menu-inactive"><a class="menu-inactive" href="quickStart.html">Quick start</a></div>
        <div class="menu-inactive"><a class="menu-inactive" href="properties.html">Properties</a></div>
        <div class="menu-active"><a class="menu-active" href="configure.html">Configuration</a></div>
        <div class="menu-inactive"><a class="menu-inactive" href="logging.html">Logging</a></div>
        <div class="menu-inactive"><a class="menu-inactive" href="admin.html">Admin</a></div>
        <div class="menu-inactive"><a class="menu-inactive" href="adminServlet.html">AdminServlet</a></div>
        <div class="menu-inactive"><a class="menu-inactive" href="listen.html">Events</a></div>
        <div class="menu-inactive"><a class="menu-inactive" href="servlets.html">Servlets</a></div>
        <div class="menu-inactive"><a class="menu-inactive" href="api/index.html">Simple API</a></div>
        <div class="menu-inactive"><a class="menu-inactive" href="howitworks.html">How it works</a></div>
        <div class="menu-inactive"><a class="menu-inactive" href="datasource.html">DataSource</a></div>
        <div class="menu-inactive"><a class="menu-inactive" href="injectableInterfaces.html">Injectable Interfaces</a></div>
    </div>
</div>
                  </td>
                  <td>&nbsp;</td>
                </tr>

                <tr>
                  <td>
                    

                    <table cellpadding="0" cellspacing="0" border="0" summary="">
                      <tbody>

                    <tr><td>







    <div class="rightItem">
        <div class="rightItemHeader">Version 0.9.0RC3</div>
        <div class="rightItemContent">
            The latest version of this documentation and software is available on our web site:
            <br/><a href="http://proxool.sf.net">proxool.sf.net</a>
        </div>
    </div>

<div class="rightItem">
    <div class="rightItemHeader">Donations</div>
    <div class="rightItemContent">
        You can donate to Proxool in the usual way:
        <br/><a href="http://sourceforge.net/project/project_donations.php?group_id=53958">sourceforge.net</a>
    </div>
</div>
</td></tr>

                <tr>
                    <td>
                        
<div class="footer">
                last&nbsp;updated: 10-Jan-2007
</div>



                    </td>
                </tr>
        </tbody>
      </table>

                  </td>
                  <td>&nbsp;</td>
                </tr>

              </tbody>
            </table>
          </td>

          <td valign="top" colspan="2">
            <table cellpadding="0" cellspacing="0" border="0" width="100%" summary="">
              <tbody>
                <tr>
                  <td class="contents" valign="top">
                    <p>You can configure Proxool in lots of ways.</p>

<div style="margin-left: 16px; margin: 8px; border-bottom: 2px solid black">
    <p><b>1</b>. Passing a java.util.Properties object to the Driver when you
    request a Connection:</p>
    <div class="codeSample">
        Properties info = new Properties();<br>
        info.setProperty(&quot;proxool.maximum-connection-count&quot;, &quot;20&quot;);<br>
        info.setProperty(&quot;proxool.house-keeping-test-sql&quot;, &quot;select&nbsp;CURRENT_DATE&quot;);<br>
        info.setProperty("user", "sa");<br/>
        info.setProperty("password", "");<br/>
        String alias = "test";<br/>
        String driverClass = "org.hsqldb.jdbcDriver";<br/>
        String driverUrl = "jdbc:hsqldb:test";<br/>
        String url = "proxool." + alias + ":" + driverClass + ":" + driverUrl;<br/>
        connection = DriverManager.getConnection(url, info);<br>
    </div>
    <p>&nbsp;</p>
</div>

<div style="margin-left: 16px; margin: 8px; border-bottom: 2px solid black">
    <p><b>2</b>. Using an XML file. For instance:</p>
    <div class="codeSample">
        &lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;<br>
        &lt;!-- the proxool configuration can be embedded within your own application's.<br>
        Anything outside the "proxool" tag is ignored. --&gt;<br>
        &lt;something-else-entirely&gt;<br>
        &nbsp;&nbsp;&lt;proxool&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&lt;alias&gt;xml-test&lt;/alias&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&lt;driver-url&gt;jdbc:hsqldb:.&lt;/driver-url&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&lt;driver-class&gt;org.hsqldb.jdbcDriver&lt;/driver-class&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&lt;driver-properties&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;property name="user" value="sa"/&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;property name="password" value=""/&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&lt;/driver-properties&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&lt;maximum-connection-count&gt;10&lt;/maximum-connection-count&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&lt;house-keeping-test-sql&gt;select CURRENT_DATE&lt;/house-keeping-test-sql&gt;<br>
        &nbsp;&nbsp;&lt;/proxool&gt;<br>
        &lt;/something-else-entirely&gt;<br>
    </div>
    <p>And then simply call the XML configurator
    (<a href="api/org/logicalcobwebs/proxool/configuration/JAXPConfigurator.html">JAXPConfigurator</a>)
    in your startup code:</p>
    <div class="codeSample">
        JAXPConfigurator.configure("src/java-test/org/logicalcobwebs/proxool/configuration/test-no-ns.xml", false);<br>
        // The false means non-validating
    </div>
    <p>And then, picking up connections is really easy ("xml-test" is the alias we used above)</p>
    <div class="codeSample">
        connection = DriverManager.getConnection("proxool.xml-test");<br/>
    </div>
    <p><b>NOTE:</b> you need to include a JAXP compliant XML parser to use this configuration
    method. For instance, <a href="http://xml.apache.org/crimson/">Crimson</a>,
    or <a href="http://xml.apache.org/xerces2-j/index.html">Xerces</a></p>
</div>

<div style="margin-left: 16px; margin: 8px; border-bottom: 2px solid black">
    <p><b>3</b>. Using a properties (flat text) file. For instance</p>
    <div class="codeSample">
        jdbc-0.proxool.alias=property-test<br>
        jdbc-0.proxool.driver-url=jdbc:hsqldb:.<br>
        jdbc-0.proxool.driver-class=org.hsqldb.jdbcDriver<br>
        jdbc-0.user=sa<br>
        jdbc-0.password=<br>
        jdbc-0.proxool.maximum-connection-count=10<br>
        jdbc-0.proxool.house-keeping-test-sql=select CURRENT_DATE<br>
    </div>
    <p>The first word (up to the first dot) must start with "jdbc", but it can be anything you like.
    Use unique names to identify each pool. Any property not starting with "jdbc" will be ignored.
    The properties prefixed with "proxool." will be used by Proxool while the properties that are
    not prefixed will be passed on to the delegate JDBC driver.  </p>
    <p>And then simply call the property configurator
    (<a href="api/org/logicalcobwebs/proxool/configuration/PropertyConfigurator.html">PropertyConfigurator</a>)
    in your startup code:</p>
    <div class="codeSample">
        PropertyConfigurator.configure("src/java-test/org/logicalcobwebs/proxool/configuration/test.properties");
    </div>
    <p>Again, picking up connections is really easy ("property-test" is the alias we used above)</p>
    <div class="codeSample">
        connection = DriverManager.getConnection("proxool.property-test");<br/>
    </div>
    <p>&nbsp;</p>
</div>

<div style="margin-left: 16px; margin: 8px; border-bottom: 2px solid black">
    <p><b>4</b>. Programmatically. For instance</p>
    <div class="codeSample">
        Class.forName("org.logicalcobwebs.proxool.ProxoolDriver");<br/>
        Properties info = new Properties();<br/>
        info.setProperty("proxool.maximum-connection-count", "10");<br/>
        info.setProperty("proxool.house-keeping-test-sql", "select CURRENT_DATE");<br/>
        info.setProperty("user", "sa");<br/>
        info.setProperty("password", "");<br/>
        String alias = "test";<br/>
        String driverClass = "org.hsqldb.jdbcDriver";<br/>
        String driverUrl = "jdbc:hsqldb:test";<br/>
        String url = "proxool." + alias + ":" + driverClass + ":" + driverUrl;<br/>
        ProxoolFacade.registerConnectionPool(url, info);
    </div>
    <p>Again, picking up connections is really easy ("test" is the alias we used above)</p>
    <div class="codeSample">
        connection = DriverManager.getConnection("proxool.test");<br/>
    </div>
    <p>&nbsp;</p>
</div>

<div style="margin-left: 16px; margin: 8px; border-bottom: 2px solid black">
    <p><b>5</b>. Using <a href="http://jakarta.apache.org/avalon">Avalon</a>
    (choose this if you already use Avalon in your project). For instance:</p>

    <p>role.config - </p>
    <div class="codeSample">
        &lt;role-list&gt;<br/>
          &nbsp;&nbsp;&lt;role<br/>
            &nbsp;&nbsp;&nbsp;&nbsp;name="org.logicalcobwebs.proxool.configuration.AvalonConfigurator"<br/>
            &nbsp;&nbsp;&nbsp;&nbsp;shorthand="proxool-config"<br/>
            &nbsp;&nbsp;&nbsp;&nbsp;default-class="org.logicalcobwebs.proxool.configuration.AvalonConfigurator"/&gt;<br/>
        &lt;/role-list&gt;
    </div>

    <p>component.config -</p>
    <div class="codeSample">
        &lt;component-config&gt;<br/>
            &nbsp;&nbsp;&lt;proxool-config&gt;<br/>
                &nbsp;&nbsp;&nbsp;&nbsp;&lt;proxool&gt;<br/>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;alias&gt;avalon-test&lt;/alias&gt;<br/>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;driver-url&gt;jdbc:hsqldb:.&lt;/driver-url&gt;<br/>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;driver-class&gt;org.hsqldb.jdbcDriver&lt;/driver-class&gt;<br/>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;driver-properties&gt;<br/>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;property name="user" value="sa"/&gt;<br/>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;property name="password" value=""/&gt;<br/>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/driver-properties&gt;<br/>
                &nbsp;&nbsp;&nbsp;&nbsp;&lt;/proxool&gt;<br/>
            &nbsp;&nbsp;&lt;/proxool-config&gt;<br/>
        &lt;/component-config&gt;
    </div>

    <p>See
    <a href="api/org/logicalcobwebs/proxool/configuration/AvalonConfigurator.html">AvalonConfigurator</a>.</p>
</div>


                  </td>
                </tr>
              </tbody>
            </table>
          </td>
        </tr>

      </tbody>
    </table>
  </div>
  </body>

  <head>
    <meta http-equiv="Expires" content="-1">
    <meta http-equiv="Pragma" content="no-cache">
  </head>

</html>