近日在写后台项目时发现在windows上运行时,不存在乱码问题,在linux运行时出现了乱码,于是就搜了好多,发现百度上好多方法并不太实用,有些运行上去出现无法与数据库连接的现象:为了使更多的人少走弯路,笔者在这里附上正确的配置
<?xml version="1.0" encoding="UTF-8"?>
<c3p0-config>
<default-config>
<property name="jdbcUrl">jdbc:mysql://IP地址:3306/test?seUnicode=true&characterEncoding=UTF-8</property>
<property name="driverClass">com.mysql.jdbc.Driver</property>
<property name="user">user001</property>
<property name="password">123456</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>