现在的位置: 首页 > 综合 > 正文

mysql中文问题和异常:org.springframework.orm.hibernate3.HibernateJdbcException

2013年08月09日 ⁄ 综合 ⁄ 共 689字 ⁄ 字号 评论关闭

异常全部显示为:

       org.springframework.orm.hibernate3.HibernateJdbcException: JDBC exception on Hibernate data access; nested exception is org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update

JDBC生成异常,在我修改我mysql5.0的my.ini文件后发生的。

情况描述:

          (1)由于mysql数据库不支持中文显示,进行解决;
如果数据库不支持中文,会出现异常,解决方法是:
1、找到mysql的配置文件:my.ini
2、修改其中的编码设置为:default-character-set=gb2312
3、重启mysql
4、drop掉原来的数据库latin1
5、create数据库
6、在运行初始化测试单元

        (2)mysql数据库支持了中文显示,但是在我的项目中却不能进行中文的插入和更新操作,出现了org.springframework.orm.hibernate3.HibernateJdbcException: JDBC exception on Hibernate data access; nested exception is org.hibernate.exception.GenericJDBCException:
Could not execute JDBC batch update

问题解决:

        进行tomcat缓存的清理,并重新启动服务器,ok.

抱歉!评论已关闭.