我想知道如何创建自己的回调 SqlMapClientTemplate. 。具体而言,我可以进行批次调用。

有帮助吗?

解决方案

我这样做的方式是覆盖 SqlMapClientCallback<T> 方法 doInSqlMapClient.

   SqlMapClientCallback<Integer> callback = new SqlMapClientCallback<Integer>() {
        public Integer doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
            executor.startBatch();
            //... do your queries here
            return executor.executeBatch();
        }
    };
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top