Mysql数据库能否批量update的配置

Posted by KANG's BLOG on Thursday, March 3, 2022

Mysql数据库能否批量update的配置

connection链接字符串中设置参数allowMultiQueries=true

jdbc:mysql://localhost:3306?<font color="red">allowMultiQueries=true</font>

官方解释:

Allow the use of ‘;’ to delimit multiple queries during one statement (true/false), defaults to ‘false’, and does not affect the addBatch() and executeBatch() methods, which instead rely on rewriteBatchStatements. Default: false Since version: 3.1.1