Sorry, I forgot to write the subject.
2008/8/26, Ali Ok <[EMAIL PROTECTED]>: > > Hi all, > > I want to use DBCP for pooling. First of all I want to write my environment > needed to explain the problem: > > - An application server other than Tomcat > - Mysql 5 > - DBCP > > > So, I want to create a datasource from the application server and use it > with connection pooling. > Is BasicDataSource provides pooling also? As I understand, Tomcat pools the > connections if I use BasicDataSource; not DBCP. If I dont use Tomcat, I wont > be able to use BasicDataSource for pooling, right? > However, I will use an application server other than Tomcat. I browsed and > investigated javadocs and all documents and I understand this can be done > using > PoolableConnectionFactory<http://commons.apache.org/dbcp/apidocs/org/apache/commons/dbcp/PoolableConnectionFactory.html>and > PoolingDataSource<http://commons.apache.org/dbcp/apidocs/org/apache/commons/dbcp/PoolingDataSource.html>. > > <http://commons.apache.org/dbcp/apidocs/org/apache/commons/dbcp/PoolableConnectionFactory.html> > Since PoolingConnectionFactory does not have a default constructor, I think > I have to do some explicit operations. > So, my question is: is there a way to do connection pooling using a > datasource which can function correctly on an application server other than > Tomcat with DBCP? > > For example, configuration below within a application server would be > great: > * > <Resource name="jdbc/mbJDBCDataSource" auth="Container" > type="**org.apache.commons.dbcp.PoolingDataSource**" > factory="**org.apache.commons.dbcp.PoolableConnectionFactory**" > maxActive="100" maxIdle="30" maxWait="10000" username="user" > password="password" > driverClassName="com.mysql.jdbc.Driver" > url="jdbc:mysql://localhost/mydb"></Resource> > > <http://commons.apache.org/dbcp/apidocs/org/apache/commons/dbcp/PoolableConnectionFactory.html> > ***
