当前位置:知识百问>百科问答>ibatis中sqlmapExecutor.executeBatch()怎么返回成功的记录数为什么总是返回0 求大神

ibatis中sqlmapExecutor.executeBatch()怎么返回成功的记录数为什么总是返回0 求大神

2023-05-27 14:55:20 编辑:join 浏览量:554

ibatis中sqlmapExecutor.executeBatch()怎么返回成功的记录数为什么总是返回0 求大神

executor.startBatch(); //一定要有,通知开始批量 int batch = 0; for(TreeCate TreeCate:TreeCateList){ //调用获取sequence的方法。如果没有的话就去掉这行代码。 TreeCate.setTreeCateId(getNextId()); //参数世冲燃1为:ibatis中需要执行的语句的id ,参搜虚数2为要插入的数据 executor.insert("TreeCate_insertTreeCate", TreeCate); batch++; //每500条批量提交一次。判槐 if(batch==500){ executor.executeBatch(); batch = 0; } } executor.executeBatch(); //将最后的数据执行,最后不够500条的数据 return null; } }); }

标签:返回,ibatis,sqlmapExecutor

版权声明:文章由 知识百问 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.zhshbaiwen.com/answer/114977.html
热门文章