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
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.
Last edited by karldmoore; Aug 29th, 2007 at 11:29 AM.
Barracuda Networks SSL VPN Lead Developer
http://pramatr.wordpress.com
http://twitter.com/karldmoore
http://www.linkedin.com/in/karldmoore
Any postings are my own opinion, and should not be attributed to my employer or clients.
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 } }
Last edited by silent.wong; Jul 2nd, 2007 at 08:08 PM.
To the world you are just one person, but to one person you might be the whole world.
--------------------
http://silentwong.javaeye.com
There are also some more examples here.
http://forum.springframework.org/showthread.php?t=31652
Last edited by karldmoore; Aug 29th, 2007 at 11:29 AM.
Barracuda Networks SSL VPN Lead Developer
http://pramatr.wordpress.com
http://twitter.com/karldmoore
http://www.linkedin.com/in/karldmoore
Any postings are my own opinion, and should not be attributed to my employer or clients.