I have the following code:
public void createFilter(String value1, String value2, Map<String, Object> value3) {
jdbcTemplate.update("INSERT INTO mytable(string_column1, string_column2, json_column3) VALUES(?, ?, ?)", new PreparedStatementSetter() {
public void setValues(PreparedStatement stmt) throws SQLException {
stmt.setString(1, value1);
stmt.setString(2, value2);
stmt.setObject(3, value3);
}
});
}
The json_column3 is of type JSON. When I execute this method, I have the following error message:
Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.; nested exception is com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'."
I will be very appreciated for any help.