jmcnally    02/05/24 11:09:26

  Modified:    xdocs    jdbc2pool-howto.xml
  Log:
  a bit more cleanup.  should be ready for consumption
  
  Revision  Changes    Path
  1.4       +27 -22    jakarta-turbine-torque/xdocs/jdbc2pool-howto.xml
  
  Index: jdbc2pool-howto.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/xdocs/jdbc2pool-howto.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- jdbc2pool-howto.xml       24 May 2002 07:12:12 -0000      1.3
  +++ jdbc2pool-howto.xml       24 May 2002 18:09:26 -0000      1.4
  @@ -14,7 +14,8 @@
   <p>
   This document is only relevant for Torque-3.0b3 and higher versions.  For
   instructions on configuring torque's built-in connection pool in earlier
  -versions see <a href="tutorial.html">the tutorial</a>.
  +versions see the runtime configuration section of 
  +<a href="tutorial.html">the tutorial</a>.
   </p>
   
   <p>
  @@ -49,22 +50,36 @@
   The first line defines the adapter that will be used to compensate for
   the differences between databases.  The valid values are:
   
  +<table align="center">
  +<tr>
  +<td>
   <ul>
     <li>as400</li>
     <li>db2app</li>
     <li>db2net</li>
     <li>cloudscape</li>
     <li>hypersonic</li>
  +</ul>
  +</td>
  +<td>
  +<ul>
     <li>interbase</li>
     <li>instantdb</li>
     <li>mssql</li>
     <li>mysql</li>
     <li>oracle</li>
  +</ul>
  +</td>
  +<td>
  +<ul>
     <li>postgresql</li>
     <li>sapdb</li>
     <li>sybase</li>
     <li>weblogic.</li>
   </ul>
  +</td>
  +</tr>
  +</table>
   
   The second line defines the string that will be used to lookup the 
   <code>DataSource</code> within the default jndi <code>InitialContext</code>.
  @@ -77,14 +92,13 @@
   you can specify any other environment properties that are needed to instantiate
   the <code>InitialContext</code> as extra properties of the form,
   torque.jndi.&lt;handle&gt;.&lt;env-var&gt;.  A couple examples are shown below:
  +</p>
   
   <source><![CDATA[
   torque.jndi.bookstore.java.naming.factory.initial = 
org.apache.naming.java.javaURLContextFactory
   torque.jndi.bookstore.java.naming.factory.url.pkgs = org.apache.naming
   ]]></source>
   
  -</p>
  -
   </section>
   
   <section name="Using torque to bind pool">
  @@ -109,8 +123,8 @@
   
   <source><![CDATA[
   
torque.datasource.DBbookstore.factory=org.apache.commons.jdbc2pool.adapter.DriverAdapterCPDS
  -torque.datasource.DBbookstore.driver = @DATABASE_DRIVER@
  -torque.datasource.DBbookstore.url = @DATABASE_URL@
  +torque.datasource.DBbookstore.driver = org.gjt.mm.mysql.Driver
  +torque.datasource.DBbookstore.url = jdbc:mysql://localhost:3306/bookstore
   torque.datasource.DBbookstore.user = root
   torque.datasource.DBbookstore.password = 1234
   ]]></source>
  @@ -132,12 +146,14 @@
   <p>Torque uses the jndi path properties to know where to deploy the 
   configured objects.  So you would have the two following properties in
   addition to the datasource props:
  +</p>
   
   <source><![CDATA[
   torque.jndi.bookstore.path=jdbc/bookstore
   torque.jndi.DBbookstore.path=jdbc/DBbookstore
   ]]></source>
   
  +<p>
   where the second handle, DBbookstore, has no relevance to torque, other than 
   to uniquely identify this group of properties as belonging together.  Any 
   unique handle may be used.
  @@ -158,12 +174,12 @@
   
   <p>In server.xml, the following would be added to the &lt;Context&gt; for your
   webapp:
  +</p>
   
   <source><![CDATA[
  -
    <Resource name="jdbc/ScarabDB" auth="Container"
               type="org.apache.commons.jdbc2pool.TorqueClassicDataSource"/>
  -  <ResourceParams name="jdbc/ScarabDB">
  +  <ResourceParams name="jdbc/bookstore">
       <parameter>
         <name>factory</name>
         <value>org.apache.commons.jdbc2pool.TorqueClassicDataSource</value>
  @@ -185,16 +201,13 @@
       </parameter>
   
     </ResourceParams>
  -
   ]]></source>
  -</p>
  -
   
   <p>In web.xml.  Elements must be given in the order of the dtd described in 
   the servlet specification:
  +</p>
   
   <source><![CDATA[
  -
   <resource-ref>
     <description>
       Resource reference to a factory for java.sql.Connection
  @@ -202,7 +215,7 @@
       database that is configured in the server.xml file.
     </description>
     <res-ref-name>
  -    jdbc/ScarabDB
  +    jdbc/bookstore
     </res-ref-name>
     <res-type>
       org.apache.commons.jdbc2pool.TorqueClassicDataSource
  @@ -211,19 +224,19 @@
       Container
     </res-auth>
   </resource-ref>
  -
   ]]></source>
  -</p>
   
   <p>
   Catalina deploys all objects configured similarly to above within the
   <strong>java:comp/env</strong> namespace so the jndi path given in
   Torque.properties would be
  +</p>
   
   <source><![CDATA[
   torque.jndi.bookstore.path=java:comp/env/jdbc/bookstore
   ]]></source>
   
  +<p>
   Remember that commons-sandbox/jdbc2pool pools expect a 
   <code>ConnectionPoolDataSource</code>
   available via jndi under the name given in the dataSourceName, so you will
  @@ -288,14 +301,6 @@
   # Default: true
   
   torque.idbroker.prefetch=true
  -
  -# IDBroker can grab its own connection from the pool to use when retrieving
  -# more id's to minimize the amount of time ID_TABLE will be locked. 
  -# Some usage of IDBroker or assumptions made by connection pools or jdbc 
  -# drivers may disallow this optimization in which case the property 
  -# should be set to false.
  -
  -torque.idbroker.usenewconnection=true
   
   ]]></source>
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to