Check whether the database encoding format is utf8
show variables
like
'character%'
;
View database connection profiles
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/databaseName?useUnicode=true&characterEncoding=UTF-8
jdbc.username=root
jdbc.password=root
Pay special attention to:
jdbc:mysql://localhost:3306/databaseName?useUnicode=true&characterEncoding=UTF-8
This only applies to xml files. If you configure it as a properties file and read data, garbled characters will still appear.
In the properties file amp; to remove the writing as follows:
jdbc:mysql://localhost:3306/databaseName?useUnicode=true&characterEncoding=UTF-8
debug trace the data to see where the data goes wrong.