ホームページ  >  記事  >  データベース  >  ibatis之批量操作实例

ibatis之批量操作实例

WBOY
WBOYオリジナル
2016-06-07 15:55:111118ブラウズ

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 までご連絡ください。