commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Latha.Kamat...@cybernetsoft.com
Subject How can I use the org.apache.commons.dbcp.PoolingDataSource?
Date Wed, 29 Jun 2005 12:53:56 GMT
Dear Experts,

I am developing a web application using struts 1.1
I am new to this struts environment.

My app needs connection pooling,
I plan to use org.apache.commons.dbcp.PoolingDataSource.
Does the 'BasicDataSource' not support connection pooling?

I configure the database properties in the struts-config.xml file as 

<data-sources>
                <data-source 
type="org.apache.commons.dbcp.BasicDataSource">
                        <set-property property="driverClassName" 
value="com.jnetdirect.jsql.JSQLDriver" />
                        <set-property property="url" 
value="jdbc:JSQLConnect://myserver/mysqldb" />
                        <set-property property="username" value="sa" />
                        <set-property property="password" value="password" 
/>
                </data-source>
        </data-sources>

Its working when I use the following in my action class as

BasicDataSource ds = getDataSource(request);


But i now have doubt that when we use 'PoolingDataSource' and how can I 
configure it in struts-config.xml file and access it inside the code?

And how can I check that the connection is retrived from the pool instead 
its creating newly?

Any help wud be appriciated.

Thanks in advance
Latha



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message