Results 1 to 5 of 5

Thread: database Connection pool query

  1. #1
    Join Date
    Jun 2007
    Posts
    1

    Smile database Connection pool query

    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

  2. #2

    Default

    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...

  3. #3
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,425

    Default

    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.

  4. #4
    Join Date
    Jun 2007
    Location
    canton,china,
    Posts
    7

    Default

    The following code hope you can help:

    The datasource bean.xml config.
    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>
    The dao implement.
    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

  5. #5
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,425

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •