近日在寫後臺項目時發現在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>