Could not execute JDBC batch update

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
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值