<bean id= "DataSource" class= "Com.mchange.v2.c3p0.ComboPooledDataSource" >
<!--Specify the drive to connect to the database
<property name= "Driverclass" value= "${jdbc.driverclassname}"/>
<!--specify url--> to connect to the database
<property name= "Jdbcurl" value= "${jdbc.url}"/>
<!--Specify the user name to connect to the database--
<property name= "user" value= "${jdbc.username}"/>
<!--specify a password to connect to the database--
<property name= "Password" value= "${jdbc.password}"/>
<property name= "maxpoolsize" value= "${jdbc.maxpoolsize}"/>
<property name= "minpoolsize" value= "${jdbc.minpoolsize}"/>
<!--the number of initialization connections for the specified connection pool should be between Minpoolsize and Maxpoolsize. Default:3-->
<property name= "initialpoolsize" value= "${jdbc.initialpoolsize}"/>
<!--maximum idle time, unused in 60 seconds, the connection is discarded. If 0, it will never be discarded. Default:0-->
<property name= "MaxIdleTime" value= "${jdbc.maxidletime}"/>
<!--c3p0 The number of connections that are fetched at the same time when the connection in the connection pool is exhausted. Default:3-->
<property name= "acquireincrement" value= "${jdbc.acquireincrement}"/>
<!--JDBC Standard to control the number of preparedstatements loaded within the data source However, because the pre-cached statements belong to a single connection instead of the entire connection pool, setting this parameter takes into account a number of factors. If both maxstatements and maxstatementsperconnection are 0, The cache is closed. Default:0-->
<property name= "maxstatements" value= "${jdbc.maxstatements}"/>
<!--check for idle connections in all connection pools every 60 seconds. Default:0--
<property name= "Idleconnectiontestperiod" value= "${jdbc.idleconnectiontestperiod}"/>
</bean>
Jdbc.driverclassname=com.mysql.jdbc.driver
jdbc.url=jdbc:mysql://x.x.x.x:3306/x
Jdbc.username=x
Jdbc.password=x
Jdbc.initialpoolsize=20
jdbc.maxpoolsize=100
jdbc.minpoolsize=10
jdbc.maxidletime=600
Jdbc.acquireincrement=5
Jdbc.maxstatements=5
Jdbc.idleconnectiontestperiod=60
Spring Configuration C3PO