org.springframework.jdbc.UncategorizedSQLException解决
org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [INSERT INTO test_content(content_id, content) VALUES (?, ?)]; SQL state [HY000]; error code [1366]; Incorrect string value: '\xE3\x80\x80<br...' for column 'content' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xE3\x80\x80<br...' for column 'content' at row 1
content是text类型的 后来发现是插入的字符串长度超过了text长度,所以报了上面的错误
补充: 一个BLOB或TEXT列,最大长度为65535(216-1)个字符。
MEDIUMBLOB MEDIUMTEXT 一个BLOB或TEXT列,最大长度为16777215(224-1)个字符。
LONGBLOB LONGTEXT 一个BLOB或TEXT列,最大长度为4294967295(232-1)个字符。
解决方案: 将content是类型改为一个更大长度的类型