1、config.properties文件配置
mysql数据库连接必须配置:&allowMultiQueries=true
例如:jdbc:mysql://192.168.1.236:3306/test?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true/
2、配置文件配置(spring-datasource.xml)
<span style="white-space:pre"> </span><bean id="dataSourceOne" class="com.alibaba.druid.pool.DruidDataSource" destroy-method="close">
<property name="proxyFilters">
<list>
<ref bean="stat-filter" />
<ref bean="wall-filter"/>
</list>
</property>
</bean>
<span style="white-space:pre"> </span><bean id="wall-filter" class="com.alibaba.druid.wall.WallFilter">
<property name="config" ref="wall-config" />
</bean>
<bean id="wall-config" class="com.alibaba.druid.wall.WallConfig">
<property name="multiStatementAllow" value="true" />
</bean>
3、Mapper实例
<span style="white-space:pre"> </span><update id="batchUpdate" parameterType="map" >
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
update kq_t_result
<set>
apply_id=${item.test}
</set>
where id = ${item.id}
</foreach>
</update>
完成!!!
如果第一步和第二步没做便会报错:r
-----------------------