日期:2014-05-16  浏览次数:20383 次

iBatis 的配置文件中同时执行两条语句

1、在连接字符串中加入 allowMultiQueries=true 参数

?

<property name="driverUrl" value="jdbc:mysql://192.168.1.102:3306/dbname?useUnicode=true&amp;characterEncoding=UTF-8&amp;autoReconnect=true&amp;failOverReadOnly=false&amp;allowMultiQueries=true"/>

?

2、xml中加入分号

update device set space=? #{space};

update users set backuptime=NOW() where userid = #{userid};