C3P0-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<c3p0-config>
<!-- This app is massive! -->
<named-config name="mvcapp">//
<property name="user">root</property>
<property name="password">123456</property>
<property name="driverclass">com.mysql.jdbc.Driver</property>
<property name="jdbcUrl">jdbc:mysql://127.0.0.1/customers</property>
<property name="password">123456</property>
<property name="acquireIncrement">5</property>
<property name="initialPoolSize">10</property>
<property name="minPoolSize">10</property>
<property name="maxPoolSize">50</property>
<!-- intergalactoApp adopts a different approach to configuring statement caching -->
<property name="maxStatements">20</property>
<property name="maxStatementsPerConnection">5</property>
</named-config>
</c3p0-config>
其中mvcapp在后面DButils中连接数据库使用
记得加入C3P0的jar包
假如C3P0出现No Suitable driver
解决方案 :在%JAVA_HOME%jrelibext下添加mysql-connector-java-5.1.12-bin.jar 问题解决!