您的位置:首页 > 编程语言 > Java开发

org.springframework.jdbc.UncategorizedSQLException:

2014-10-10 21:39 543 查看

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是类型改为一个更大长度的类型
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐