1. When configuring the parameters for connecting to the database in xml
Add the connection string encoding when connecting to the database after the jdbcUrl attribute
<?xml version="1.0" encoding="UTF-8"?>
<c3p0-config>
<default-config>
<property name="driverClass">com.mysql.jdbc.Driver</property>
<property name="jdbcUrl">jdbc:mysql://localhost:3306/dms?useUnicode=true&characterEncoding=UTF-8</property>
<property name="user">root</property>
<property name="password">12345</property>
</default-config>
</c3p0-config>
2. When configuring the parameters for connecting to the database in db.properties
Add the connection string encoding when connecting to the database after the jdbcUrl attribute
dataSource.driverClass=com.mysql.jdbc.Driver
dataSource.jdbcUrl=jdbc:mysql://127.0.0.1:3306/dms?useUnicode=true&characterEncoding=utf8
dataSource.user=root
dataSource.password=12345