Could not execute JDBC batch update

来源:互联网 发布:unity3d游戏开发流程 编辑:程序博客网 时间:2024/05/16 23:46
org.springframework.beans.factory.BeanCreationException:
 Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0'
 defined in ServletContext resource [/WEB-INF/queryservice-servlet.xml]:
 Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException:
 Error creating bean with name 'videoController': 
Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException:
 Could not autowire field: com.jrgy.util.FileUpload com.jrgy.main.controller.VideoController.fileUpload;
 nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: 
No unique bean of type [com.jrgy.util.FileUpload] is defined:

 Unsatisfied dependency of type [class com.jrgy.util.FileUpload]: expected at least 1 matching bean



关于hibernate 错误 Could not execute JDBC batch update。 

主要是配置文件设置了关联,数据却没有关联造成的,只要数据正确就没有问题。

1. 重点注意主键的映射关系是否配置正确,因为Hibernate Tools(或者Eclipse本身的Database Explorer)生成*.hbn.xml工具中包含有catalog="***"*表示数据库名称)这样的属性,将该属性删除就可以了

2. 是由更新数据库表时,插入的数据与字段不匹配引起的。比如字段A已设为只允许有0和1值,但你却插入了一个空值或其它值,则就会报这个错误。 还一个就是字段超长。

3. 数据库表的列名是否为关键字命名列的时候不要单独使用date,ID...这种关键字 

4. 不能批量更新,这个错误是因为一次性更新多条数据。 

5. 另外,造成这个原因的还可能是数据库的驱动jar包不支持。






0 0
原创粉丝点击