<?xml version="1.0" encoding="UTF-8"?>
<c3p0-config>
<!-- 这是默认配置信息 -->
<default-config>
<!-- 连接四大参数配置 -->
<property name="jdbcUrl">jdbc:mysql://localhost:3306/数据库名?useUnicode=true&characterEncoding=utf-8</property>
<property name="driverClass">com.mysql.jdbc.Driver</property>
<property name="user">用户名</property>
<property name="password">密码</property>
<!-- 池参数配置 -->
<property name="acquireIncrement">3</property>
<property name="initialPoolSize">10</property>
<property name="minPoolSize">2</property>
<property name="maxPoolSize">10</property>
</default-config>
</c3p0-config>
注:useUnicode=true&characterEncoding=utf-8不加的话,不能搜索中文格式
最后知道了是我的mysql版本太低,hhh.