mybatis执行update批量更新时报错

来源:互联网 发布:今年网络教育报名时间 编辑:程序博客网 时间:2024/05/22 12:03
在使用Mybatis 批量更新时,报如下错误
### The error may involve cn.jointwisdom.vUniversity.dao.updateAccessNum-Inline  ### The error occurred while setting parameters  ### SQL: update college    SET accessNum =? where id=? ; update college    SET accessNum =? where id=? ; update college    SET accessNum =? where id=? ;  

这是因为配置mysql的时候没有开启批量插入,不开启的话只能允许操作一条sql语句,所以只需要修改一处即可:将properties配置文件中的数据库连接信息URL后面添加上&allowMultiQueries=true就可以了,如图:


注意:请不要将“&”符号写成“&”

0 0
原创粉丝点击