org.springframework.dao.InvalidDataAccessResourceUsageException: Could not execute JDBC batch update

org.springframework.dao.InvalidDataAccessResourceUsageException: Could not execute JDBC batch update; nested exception is org.hibernate.exception.DataException: Could not execute JDBC batch update

用的spring+struts2+hibernate框架,在提交表单时,出现这个错误
之前修改过实体Bean int userId 改成了String userId
数据库中没有更新过来

遇到这种情况,有2中解决方法:
1.在数据库中修改字段类型为varchar
2.删除这个字段,重启项目,让hibernate自动生成正确的字段

原文地址:https://www.cnblogs.com/zhouyalei/p/3042831.html