Announcement Announcement Module
Collapse
No announcement yet.
database Connection pool query Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

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

    Comment


    • #3
      We've used c3p0 on a few projects, but I'd agree with the previous comments.
      Last edited by karldmoore; Aug 29th, 2007, 12:29 PM.

      Comment


      • #4
        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, 09:08 PM.

        Comment


        • #5
          There are also some more examples here.
          http://forum.springframework.org/showthread.php?t=31652
          Last edited by karldmoore; Aug 29th, 2007, 12:29 PM.

          Comment

          Working...
          X