Home  >  Article  >  Database  >  ibatis之批量操作实例

ibatis之批量操作实例

WBOY
WBOYOriginal
2016-06-07 15:55:111118browse

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);
}
}
}
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn