Problem Description
When executing a SQL statement (including Chinese values in the statement), the following error occurs:
java.sql.SQLException: Incorrect string value: '\xE6\x98\xAF","...' for column 'previous_request' at row 1
problem causes
The encoding format of the field is wrong, we need to check the database encoding, and to check the encoding of the data table field
Solution
The database has been set to utf8mb4 encoding, and the field is modified to utf8mb4 encoding
If the data is "simple" Unicode characters, uft8 encoding can be used directly. But it is still recommended to use utf8mb4 encoding to avoid unnecessary trouble in the future (for example, adjust to utf8mb4 encoding again to store emoji expressions, after all, the demand is growing)
references
K4NZ / java.sql.SQLException: Incorrect string value: 'xxx","...' for column 'xxx' at row 1
mysql - java.sql.SQLException: Incorrect string value: '\xF0\x9F\x91\xBD\xF0\x9F...' - Stack Overflow