struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jitesh Sinha" <jsi...@cisco.com>
Subject BasicDataSource class of package org.apache.commons.dbcp
Date Wed, 17 Dec 2003 09:41:52 GMT
Hello all,

I am making use of BasicDataSource class to get connections .The code which
I write to get a connection is as follows :

		    basicDataSource = new BasicDataSource();
                basicDataSource.setDefaultAutoCommit(autoCommit);
                basicDataSource.setUrl(jdbcUrl);
                basicDataSource.setDriverClassName(driver);
                basicDataSource.setUsername(user);
                basicDataSource.setPassword(password);
                basicDataSource.setMaxIdle(maxIdle);
                basicDataSource.setMaxActive(maxConn);

basicDataSource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
                basicDataSource.setMaxWait(maxWait);
                basicDataSource.setRemoveAbandoned(removeAbandoned);
                basicDataSource.setLogAbandoned(logAbandoned);
                basicDataSource.setValidationQuery(validationQuery);

Connection conn =basicDataSource.getConnection() ;

Does getConnection() method of BasicDataSource  create a new connection to
the database or internally manage some connection pool from which a new
connection is taken?
Will I need to write any extra code to make use of a connectionpool ?

Thanks,
Jitesh


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message