1

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.

7

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.