mybatis批量更新时,allowMultiQueries

使用mybatis进行批量更新操作:

报错如下:

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update
   user_info g
            SET
                update_date = '2019-03-19 17:16:05.918',
                updat' at line 28


但是检查了之后,对应没有报错,且本地没有问题。


最后查询得知:

是因为springboot 配置文件中,关于数据库的链接配置,并没有允许进行批量更新操作。


解决方法:

将数据库配置修改为:

jdbc.url=jdbc:mysql://127.0.0.1:3306/datebase?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&allowMultiQueries=true

新增了 &allowMultiQueries=true 意为 允许批量更新


展开阅读全文

页面更新:2024-04-27

标签:批量   操作   链接   数据库   科技

1 2 3 4 5

上滑加载更多 ↓
推荐阅读:
友情链接:
更多:

本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828  

© CopyRight 2020-2024 All Rights Reserved. Powered By 71396.com 闽ICP备11008920号-4
闽公网安备35020302034903号

Top