Spring 的C3p0连接池是在程序第一次访问数据库时创建的
第一次访问数据库时,相应的SERVICE BEAN的依赖于dataSource,然后由dataSource启动连接池
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="${jdbc.driverClassName}" />
<property name="jdbcUrl" value="${jdbc.url}" />
<property name="user" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<property name="initialPoolSize" value="3" />
<property name="maxPoolSize" value="30" />
<property name="minPoolSize" value="2" />
<property name="maxIdleTime" value="60" />
<property name="maxStatements" value="0" />
<property name="maxStatementsPerConnection" value="80" />
<property name="acquireIncrement" value="1" />
</bean>