• Post Reply Bookmark Topic Watch Topic
  • New Topic

Has anyone used the JAKARTA DBCP with JOCL?  RSS feed

Sumit Gupta
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If anyone has, I'd like to hear how you implemented the username and password for the DB.
the sample JOCL that they provide only the connect string. Can i append user and pass to that somehow? here is the sample jocl xml:
<object class="org.apache.commons.dbcp.PoolableConnectionFactory" xmlns="http://apache.org/xml/xmlns/jakarta/commons/jocl">
<!-- the first argument is the ConnectionFactory -->
<object class="org.apache.commons.dbcp.DriverManagerConnectionFactory">
<string value="jdbc:some:connect:string"/>
<object class="java.util.Properties" null="true"/>
<!-- the next argument is the ObjectPool -->
<object class="org.apache.commons.pool.impl.GenericObjectPool">
<object class="org.apache.commons.pool.PoolableObjectFactory" null="true"/>
<int value="10"/> <!-- max active -->
<byte value="1"/> <!-- when exhausted action, 0 = fail, 1 = block, 2 = grow -->
<long value="2000"/> <!-- max wait -->
<int value="10"/> <!-- max idle -->
<boolean value="false"/> <!-- test on borrow -->
<boolean value="false"/> <!-- test on return -->
<long value="10000"/> <!-- time between eviction runs -->
<int value="5"/> <!-- number of connections to test per eviction run -->
<long value="5000"/> <!-- min evictable idle time -->
<boolean value="true"/> <!-- test while idle -->
<!-- the next argument is the KeyedObjectPoolFactory -->
<object class="org.apache.commons.pool.StackKeyedObjectPoolFactory">
<int value="5"/> <!-- max idle -->
<string value="SELECT COUNT(*) FROM DUAL"/> <;!-- validation query -->
<boolean value="false"/> <!-- default read only -->
<boolean value="true"/> <!-- default auto commit -->
any help would be appreciated. here is a URL to the api if anyone is interested:
Garrett Smith
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Put your db connection url there.

Try out the commons list. sign up at jakarta.apacha.org.


See? Use a query string: ?user=root&amp;password=my_pw
Since it's xml, you have to escape the & to &amp;
[ October 25, 2002: Message edited by: Garrett Smith ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!