首页  >  文章  >  数据库  >  ibatis之批量操作实例

ibatis之批量操作实例

WBOY
WBOY原创
2016-06-07 15:55:111116浏览

public void batchUpdateExec(String sqlId, ListObject param) throws DaoException { if (sqlId != null sqlId.length() 0) { if (param != null param.size() 0) { try { this.getSqlMapClient().startBatch(); for (int i = 0; i param.size(); i) { thi

public void batchUpdateExec(String sqlId, List param) throws DaoException {
if (sqlId != null && sqlId.length() > 0) {
if (param != null && param.size() > 0) {
try {
this.getSqlMapClient().startBatch();
for (int i = 0; i this.getSqlMapClient().update(sqlId, param.get(i));
}
this.getSqlMapClient().executeBatch();
} catch (SQLException e) {
throw new DaoException(e);
}
}
}
}
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn