【问题】:mybatis批量更新报错,提示sql有问题,但是并没有问题
【解决办法】:mybatis默认不支持批量更新操作,最简单的解决办法是:在数据库的配置时候加入参数,如下所示:allowMultiQueries=true
spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
#MySQL配置
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/mall?allowMultiQueries=true&useUnicode=yes&characterEncoding=UTF-8&useInformationSchema=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
username: root
password: 123456