applicationContext.xml 文件:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd">
<bean id="dataSource"
class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="driverClass">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="jdbcUrl">
<value>jdbc:mysql://192.168.3.110:3306/DBName?useUnicode=true&;characterEncoding=GBK</value>
</property>
<property name="user">
<value>root</value>
</property>
<property name="password">
<value>root</value>
</property>
<!——连接池中保留的最小连接数。——>
<property name="minPoolSize">
<value>5</value>
</property>
<!——连接池中保留的最大连接数。Default: 15 ——>
<property name="maxPoolSize">
<value>30</value>
</property>
<!——初始化时获取的连接数,取值应在minPoolSize与maxPoolSize之间。Default: 3 ——>
<property name="initialPoolSize">
<value>10</value>
</property>
<!——最大空闲时间,60秒内未使用则连接被丢弃。若为0则永不丢弃。Default: 0 ——>
<property name="maxIdleTime">
<value>60</value>
</property>
<!——当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default: 3 ——>
<property name="acquireIncrement">
<value>5</value>
</property>

