Struts has detected an unhandled exception:
Messages:
1. Incorrect string value: '\xA1\xAA\xA1\xAA\xB0\xFC...' for column 'content' at row 1
2. Hibernate flushing: Could not execute JDBC batch update; uncategorized SQLException for SQL [insert into blog (comments, content, createdate, description, tid, title, uid, id) values (?, ?, ?, ?, ?, ?, ?, ?)]; SQL state [HY000]; error code [1366]; Incorrect string value: '\xA1\xAA\xA1\xAA\xB0\xFC...' for column 'content' at row 1; nested exception is java.sql.BatchUpdateException: Incorrect string value: '\xA1\xAA\xA1\xAA\xB0\xFC...' for column 'content' at row 1
File: com/mysql/jdbc/ServerPreparedStatement.java
Line number: 657最近在发表文章的时候 却出现了这样的错误。
不知道什么原因 ,在有时插入的时候不会出错 但有时又出错。。
后来发现 原来是mysql的表中字段为gb2312_chinese_ci 而程序中使用的utf-8 这可能是乱码所致。
参考:[url]http://www.java1995.cn/blog/item/17[/url]
729

被折叠的 条评论
为什么被折叠?



