再平时的工作、学习中,我们会遇见插入,修改,删除多个表的操作,我们不可能写多条insert标签等,这就需要在一个标签中写多个SQL语句
insert into enters_sells_saves.purchase ( amount, price, purchase_time) values (#{amount},#{price},#{purchaseTime}); insert into enters_sells_saves.goods (goods_name) values (#{goodsName}); insert into enters_sells_saves.supplier (supplier_name) values (#{supplierName});
需要我们在数据库连接配置中加入:
allowMultiQueries=true
如:
jdbc:mysql://localhost:3306/enters_sells_saves?useSSL=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT&allowMultiQueries=true
这样就可以在一个标签中使用多个sql语句了



