docs: public int[] withBatch(int batchSize, String sql, Closure closure) throws SQLException {
          Connection connection = createConnection();
          List<Tuple> indexPropList = null;
          SqlWithParams preCheck = buildSqlWithIndexedProps(sql);
          boolean savedWithinBatch = withinBatch;
          BatchingPreparedStatementWrapper psWrapper = null;
          if (preCheck != null) {
              indexPropList = new ArrayList<Tuple>();
              for (Object next : preCheck.getParams()) {
                  indexPropList.add((Tuple) next);
              }
              sql = preCheck.getSql();
          }
  
          try {
              withinBatch = true;
              PreparedStatement statement = (PreparedStatement) getAbstractStatement(new CreatePreparedStatementCommand(0), connection, sql);
              configure(statement);
              psWrapper = new BatchingPreparedStatementWrapper(statement, indexPropList, batchSize, LOG, this);
              closure.call(psWrapper);
              return psWrapper.executeBatch();
          } catch (SQLException e) {
              LOG.warning("Error during batch execution of '" + sql + "' with message: " + e.getMessage());
              throw e;
          } finally {
              closeResources(psWrapper);
              closeResources(connection);
              withinBatch = savedWithinBatch;
          }
      }