سؤال

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