struts2+中文错误,我都弄了好久了,还不知什么问题出错了,请求哪位JAVA高手帮忙解决,无限感激!!!
2011-04-1117:55:47[日志信息]SQLError:1366,SQLState:HY0002011-04-1117:55:47[日志信息]Incorrect...
2011-04-11 17:55:47 [日志信息] SQL Error: 1366, SQLState: HY000
2011-04-11 17:55:47 [日志信息] Incorrect string value: '\xCC\xB8' for column 'ColumnName' at row 1
2011-04-11 17:55:47 [日志信息] Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
.....
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.BatchUpdateException: Incorrect string value: '\xCC\xB8' for column 'ColumnName' at row 1
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:656)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
... 133 more
2011-04-11 17:55:47 [日志信息] Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
2011-04-11 17:55:47 [日志信息] SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase] 展开
2011-04-11 17:55:47 [日志信息] Incorrect string value: '\xCC\xB8' for column 'ColumnName' at row 1
2011-04-11 17:55:47 [日志信息] Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
.....
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.BatchUpdateException: Incorrect string value: '\xCC\xB8' for column 'ColumnName' at row 1
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:656)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
... 133 more
2011-04-11 17:55:47 [日志信息] Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
2011-04-11 17:55:47 [日志信息] SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase] 展开
2011-04-12
展开全部
这是字符编码的问题,写一个字符拦截器在参数传递的过程中转换一下,最还使用utf-8的,这是我的习惯,还有就是以后再写程序时,最好统一你的开发工具、数据库、等的字符格式,这样可以避免程序中在出现这样的问题……
展开全部
好像是你执行sql语句的时候出的问题吧,不知道你是不是插入特殊字符的时候就报错了,如果是这样的话,可以是数据库默认的字符集和你程序的字符集的问题,你试试把数据库和程序都换成utf-8或者GBK,不要用GB2312
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
把数据库编码改一下试试看 MySQL在命令行输入 set names gbk; 将数据库字符集设成中文试试
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
jdbc的异常啊,连接数据库有问题吧
中文问题不知道有没有做filter
中文问题不知道有没有做filter
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询