Maison  >  Article  >  base de données  >  ibatis之批量操作实例

ibatis之批量操作实例

WBOY
WBOYoriginal
2016-06-07 15:55:111116parcourir

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);
}
}
}
}
Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Article précédent:动画教你使用gitArticle suivant:eXtremeDB相关问题解答(2)