ibatis 对数据批量插入方法

来源:互联网 发布:java短信发送 编辑:程序博客网 时间:2024/06/05 18:12

public boolean insertPlatMessage(List<PlatInfo> list) {
    try {

//批量插入开始

startBatch();

for (int i = 0; i < list.size(); i++) {

insert("insertPlatMessage", list.get(i));

}

//执行

executeBatch();

return true;

} catch (Exception e) {

e.printStackTrace();

}

return false;

 ibatis 对数据批量插入方法

原创粉丝点击