/** * Execute a batch of statements * * @param sessionScope - the session scope * @return - the number of rows impacted by the batch * @throws SQLException - if a statement fails */ public int executeBatch(SessionScope sessionScope) throws SQLException { int rows = 0; Batch batch = (Batch) sessionScope.getBatch(); if (batch != null) { try { rows = batch.executeBatch(); } finally { batch.cleanupBatch(sessionScope); } } return rows; }