Mysql 使用myBatis在一个事务中运行multile sql语句

Mysql 使用myBatis在一个事务中运行multile sql语句,mysql,sql,mapping,mybatis,Mysql,Sql,Mapping,Mybatis,尝试运行多个查询时,如: <insert id="insertTest"> insert into table1 values('foo'); insert into table2 values('foo'); </insert> 我尝试了以下设置的各种组合,都返回了相同的结果 ## JDBC connection properties. driver=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306

尝试运行多个查询时,如:

 <insert id="insertTest">
 insert into table1 values('foo'); 
 insert into table2 values('foo');
 </insert> 
我尝试了以下设置的各种组合,都返回了相同的结果

## JDBC connection properties.
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/test_db?allowMultiQueries=true
username=root
password=********

# If set to true, each statement is isolated
# in its own transaction.  Otherwise the entire
# script is executed in one transaction.
auto_commit=false

# This controls how statements are delimited.
# By default statements are delimited by an
# end of line semicolon.  Some databases may
# (e.g. MS SQL Server) may require a full line
# delimiter such as GO.
delimiter=;
full_line_delimiter=false

# This ignores the line delimiters and
# simply sends the entire script at once.
# Use with JDBC drivers that can accept large
# blocks of delimited text at once.
send_full_script=true

中的设置是否缺少要插入数据的列名

insert into table1 (column_name) values('foo'); 

设置看起来不错。也许问题出在第二个insert语句本身?这是唯一的演示insert,我尝试了其他要求。无论您如何切换它们,都会得到相同的sql错误不,实际上这只是演示查询,无论您尝试什么查询,都会在第二个查询中得到错误。
insert into table1 (column_name) values('foo');