oracle数据库在ibatis的批处理
来源:互联网 发布:情定三生知夏的床戏 编辑:程序博客网 时间:2024/06/14 22:41
思路一:java实现
通过Batch操作,实现insert和update的批处理。
public class BaseLevelAccessDAOImpl extends SqlMapClientDaoSupport { public void insertBaseLevelDefine(final List<BaseLevelDefineDO> list) { if (null == list) { throw new IllegalArgumentException("Can't insert a null data object into db."); } SqlMapClientCallback callback = new SqlMapClientCallback() { public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException { executor.startBatch(); for (BaseLevelDefineDO item : list) { executor.insert("BASE-LEVEL-DEFINE-INSERT", item); } executor.executeBatch(); return null; } }; getSqlMapClientTemplate().execute(callback); } public void updateBaseLevelData(final List<BaseLevelDataDO> list) { if (list == null) { throw new IllegalArgumentException("Can't update by a null data object."); } SqlMapClientCallback callback = new SqlMapClientCallback() { public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException { executor.startBatch(); for (BaseLevelDataDO tObject : list) { executor.update("BASE-LEVEL-DATA-UPDATE", tObject); } executor.executeBatch(); return null; } }; getSqlMapClientTemplate().execute(callback); } }
xml配置实现
xml实现了insert,update不知怎么弄。
<!-- mapped statement for BaseLevelAccessDAO.insertBaseLevelDefine --> <insert id="BASE-LEVEL-DEFINE-INSERT" parameterClass="java.util.List"> <![CDATA[ insert all ]]> <iterate conjunction=" " > <![CDATA[into test_table (ID,CUSTOM_TABLE_ID, FIELD,ENV,UNIMARK, GMT_CREATE) values (#list[].id#,#list[].customTableId#, #list[].field#, #list[].env#, #list[].unimark#, sysdate) ]]> </iterate> <![CDATA[select * from dual ]]> </insert>
0 0
- oracle数据库在ibatis的批处理
- ibatis的批处理
- ibatis中SqlMapConfig的oracle数据库配置
- 批处理操作Oracle数据库
- oracle数据库备份批处理
- 在ibatis下匹配特殊手机号码(oracle数据库)
- ibatis 批处理
- iBatis批处理
- ibatis批处理
- ibatis 批处理
- 关于Ibatis中批处理的一些经验
- 项目中ibatis的批处理应用实例
- oracle-ibatis like 用法,各数据库的安全拼接方法
- 使用批处理备份oracle数据库
- windows下shutdown/up oracle数据库的批处理
- ibatis中批量操作在mysql和oracle的区别
- ibatis自定义数据类型在不支持中文的数据库存储汉字
- 在SQL Server数据库中使用批处理的注意事项
- spring中@value注解需要注意
- jQuery判断浏览器是移动端还是电脑端自动跳转
- 安卓自定义View实现图片上传进度显示(仿QQ)
- 黑马程序员---c语言字符串输入总结
- Android中的Service服务绑定
- oracle数据库在ibatis的批处理
- 初学iOS UI 用于交流与学习
- 内联成员函数与重载成员函数
- java入门相关
- 剑指Offer面试题7(Java版):用两个栈实现队列与用两个队列实现栈
- 【剑指Offer面试题】 九度OJ1386:旋转数组的最小数字
- Android中Application类用法
- ajax的接受之页面,一定要有echo,html页面的返回函数success才能正常运行
- 小应用大智慧-GDB调试