public class SqlMapAccountDao extends SqlMapClientDaoSupport implements AccountDao {
...
public void insertAccount(Account account) throws DataAccessException {
getSqlMapClientTemplate().execute(new SqlMapClientCallback() {
public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
executor.startBatch();
executor.update("insertAccount", account);
executor.update("insertAddress", account.getAddress());
executor.executeBatch();
}
});
}
}
ibatis中实现批量操作
最新推荐文章于 2025-09-13 12:59:37 发布
本文介绍了一种使用Java的SqlMapClient模板进行SQL操作的封装方法,包括账户和地址的批量插入,展示了如何简化数据库操作并提高效率。
1084

被折叠的 条评论
为什么被折叠?



