jsp: charset=gb2312
数据库也是gb2312
运行时抛出异常:
java.sql.SQLException: Incorrect string value: '\xEF\xBF\xBD\xEF\xBF\xBD...' for column 'NAME' at row 1
解决办法:
struts.xml添加配置:<constant name="struts.i18n.encoding" value="gb2312"></constant>
数据库也是gb2312
运行时抛出异常:
java.sql.SQLException: Incorrect string value: '\xEF\xBF\xBD\xEF\xBF\xBD...' for column 'NAME' at row 1
解决办法:
struts.xml添加配置:<constant name="struts.i18n.encoding" value="gb2312"></constant>
本文介绍了解决在使用GB2312编码时出现的java.sql.SQLException异常的方法。通过在struts.xml文件中添加配置项struts.i18n.encoding并设置其值为gb2312,可以有效解决因字符集不匹配导致的数据插入错误。
510

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



