This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Has anyone used the JAKARTA DBCP with JOCL? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Has anyone used the JAKARTA DBCP with JOCL?" Watch "Has anyone used the JAKARTA DBCP with JOCL?" New topic

Has anyone used the JAKARTA DBCP with JOCL?

Sumit Gupta

Joined: Jan 23, 2002
Posts: 4
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="">
<!-- 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

Joined: Jun 27, 2002
Posts: 401

Put your db connection url there.

Try out the commons list. sign up at


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 ]

comp.lang.javascript FAQ:
jQuery in Action, 2nd edition
subject: Has anyone used the JAKARTA DBCP with JOCL?
Similar Threads
DBCP Null pointer exception
How to parse HTTP Post request
Anyone plz do clear my doubts!!!
Multithreading Java ETL's programs