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是类型改为一个更大长度的类型
相关文章推荐
- org.springframework.jdbc.UncategorizedSQLException
- org.springframework.jdbc.UncategorizedSQLException:
- Ibatis 报:org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized S
- org.springframework.jdbc.UncategorizedSQLException
- org.springframework.jdbc.UncategorizedSQLException 错误解决
- spring更新clob报错:org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL
- org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Cannot open connection; uncategorized SQLException for
- org.springframework.jdbc.UncategorizedSQLException
- org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLExcepti
- org.springframework.jdbc.UncategorizedSQLException: Error setting null parameter.
- org.springframework.jdbc.UncategorizedSQLException: 不允许从数据类型 varbinary 到 date 的隐式转换
- org.springframework.jdbc.UncategorizedSQLException
- SSM_bug整理:org.springframework.jdbc.BadSqlGrammarException:
- FAQ(40):org.springframework.jdbc.BadSqlGrammarException: ### Error updating database. Cause: com.m
- Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException
- org.springframework.jdbc.BadSqlGrammarException: Cause: java.sql.SQLException: Column count doesn't
- HTTP Status 500 - Request processing failed; nested exception is org.springframework.jdbc.BadSqlGram
- org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [SELECT * FROM
- org.springframework.jdbc.BadSqlGrammarException
- org.springframework.jdbc.BadSqlGrammarException: Cause: java.sql.SQLException: Column count 异常