I am having trouble inserting utf8 string into a mysql database using ‘mysql connector/j ver 8.0.29’
I am working on a java springboot application.
This problem does not happen in ‘mysql connector/j ver 8.0.27’
Anybody encounter this problem?
—- Mysql server is also 8.0.29 but there is no problem since I can successfully execute ‘INSERT’ sql command using UTF-8 on the server itself
It is only when sending ‘INSERT’ sql command via client pc using springboot that this problem happen
Server pc OS is windows10, client pc is Windows11
This is my table.
This is the error.
Caused by: java.sql.SQLException: Incorrect string value: '\x95|\x82\xA2\x98b' for column 'path' at row 1
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
this is the connection string:
spring.datasource.url=jdbc:mysql://localhost/${xpac.sql-database-name}?serverTimezone=Asia/Tokyo
this is the error:
Caused by: java.sql.SQLException: Incorrect string value: '\x95|\x82\xA2\x98b' for column 'path' at row 1 at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
怖い話 ---> '\x95|\x82\xA2\x98b'