HI ,
we are using Spring framework on Websphere 6 for our application ,
and we have lot of database intercations we need to implemnt
connection pooling.
can you pls recommend any ways of implemnting same w.r.t spring.
thanks in advance
Printable View
HI ,
we are using Spring framework on Websphere 6 for our application ,
and we have lot of database intercations we need to implemnt
connection pooling.
can you pls recommend any ways of implemnting same w.r.t spring.
thanks in advance
Use the one provided by Websphere, or use commons-dbcp, but my advice is that you read the Spring documentation and do a little Google search...
We've used c3p0 on a few projects, but I'd agree with the previous comments.
The following code hope you can help:
The datasource bean.xml config.
The dao implement.Code:<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value=""/>
<property name="url" value="" />
<property name="username" value="" />
<property name="password" value="" />
<property name="initialSize" value="1"/>
<property name="minIdle" value="1"/>
<property name="maxIdle" value="1"/>
<property name="maxActive" value="5"/>
</bean>
<bean id="dao" class="com.MyDao">
<property name="dataSource" ref="dataSource" />
</bean>
Code:public class MyDaoImple extends NamedParameterJdbcDaoSupport implements MyDao
{
public test() {
List list = getJdbcTemplate().queryForList("select * from a");
list = getNamedParameterJdbcTemplate().XXX
}
}
There are also some more examples here.
http://forum.springframework.org/showthread.php?t=31652