关于spring和数据库链接嵌套的问题备忘

<bean id="dataSource"  class="org.logicalcobwebs.proxool.ProxoolDataSource" destroy-method="close">  
        <property name="driver" value="${db.driver}"/>
        <property name="driverUrl" value="${db.url}"/>
        <property name="user" value="${db.username}"/>
        <property name="password" value="${db.password}"/>  

        <property name="alias" value="${db.username}"/>
        <property name="houseKeepingSleepTime" value="9000"/>
        <property name="prototypeCount" value="5"/>
        <property name="maximumConnectionCount" value="15"/>
        <property name="minimumConnectionCount" value="3"/>
        <property name="trace" value="true"/>
        <property name="verbose" value="true"/>
    </bean>

自己把相应的修改下 就可以了  如果不用org.logicalcobwebs.proxool.ProxoolDataSource ,用com.mchange.v2.c3p0.ComboPooledDataSource 这个也行

 <bean id="dataSource"  class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">  
        <property name="driverClass" value="${db.driver}"/>
        <property name="jdbcUrl" value="${db.url}"/>
        <property name="user" value="${db.username}"/>
        <property name="password" value="${db.password}"/>  

        <property name="initialPoolSize" value="3"/>
        <property name="minPoolSize" value="3"/>  
        <property name="maxPoolSize" value="300"/>  

        <property name="maxConnectionAge" value="3600"/>
        <property name="maxIdleTime" value="600"/>
        <property name="acquireIncrement" value="10"/>
        <property name="automaticTestTable" value="c3p0test"/>
        <property name="checkoutTimeout" value="10000"/>  
            
        <property name="maxStatements" value="100"/>  
        <property name="testConnectionOnCheckout" value="false"/>
        <property name="acquireRetryAttempts" value="5"/>
        <property name="breakAfterAcquireFailure" value="true"/>
    </bean>

你可能感兴趣的:(关于spring和数据库链接嵌套的问题备忘)