mybaits中批量插入操作注意点
来源:互联网 发布:淘宝乐高日本代购 编辑:程序博客网 时间:2024/05/20 11:35
oracle和mysql数据库的批量update在mybatis中配置不太一样:
oracle数据库:
<update id="batchUpdate" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="begin" close="end;" separator=";">
update test
<set>
test=${item.test}+1
</set>
where id = ${item.id}
</foreach>
</update>
mysql数据库:
mysql数据库采用一下写法即可执行,但是数据库连接必须配置:&allowMultiQueries=true
例如:jdbc:mysql://192.168.1.236:3306/test?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
<update id="batchUpdate" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
update test
<set>
test=${item.test}+1
</set>
where id = ${item.id}
</foreach>
oracle数据库:
<update id="batchUpdate" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="begin" close="end;" separator=";">
update test
<set>
test=${item.test}+1
</set>
where id = ${item.id}
</foreach>
</update>
mysql数据库:
mysql数据库采用一下写法即可执行,但是数据库连接必须配置:&allowMultiQueries=true
例如:jdbc:mysql://192.168.1.236:3306/test?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
<update id="batchUpdate" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
update test
<set>
test=${item.test}+1
</set>
where id = ${item.id}
</foreach>
</update>
0 0
- mybaits中批量插入操作注意点
- mybaits批量插入
- Mybaits的批量插入
- mybaits批量插入
- mybaits/ibaits注意点
- mybaits使用注意点
- mybaits批量操作数据库
- Mybaits 批量操作
- mybaits+oracle批量操作
- mybaits中的批量操作
- jdbc 批量插入 和mybaits框架批量插入对比
- Java在数据库操作中批量插入数据
- phoenix操作注意点
- jmap操作注意点
- mybaits批量新增修改
- MyBatis中批量插入
- MyBatis中批量插入
- MyBatis中批量插入
- CSDN日报20170514 ——《聪明的老板才不招工资低的程序员》
- 用gradle构建java项目
- 蛇形输出
- 水题hdu Identity Card
- ReactNative调研报告
- mybaits中批量插入操作注意点
- 正则化方法:L1和L2 regularization、数据集扩增、dropout
- centos7 mysql数据库安装和配置
- 06-图1 列出连通集 (25分)
- 读书笔记《Effective C++》条款20:宁以pass-by-reference-to-const替换pass-by-value
- HashCode和equal方法
- HDU5832-A water problem
- 线程与进程
- 超越99