문제

I'd like to know how to create my own callback for a SqlMapClientTemplate. Specifically so I can do batch calls.

도움이 되었습니까?

해결책

The way I do it is to override the SqlMapClientCallback<T> method 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