code: public void query(String sql, Closure closure) throws SQLException {
          Connection connection = createConnection();
          Statement statement = getStatement(connection, sql);
          ResultSet results = null;
          try {
              results = statement.executeQuery(sql);
              closure.call(results);
          } catch (SQLException e) {
              LOG.warning("Failed to execute: " + sql + " because: " + e.getMessage());
              throw e;
          } finally {
              closeResources(connection, statement, results);
          }
      }
docs: Performs the given SQL query, which should return a single
  <code>ResultSet</code> object. The given closure is called
  with the <code>ResultSet</code> as its argument.
  <p>
  Example usages:
  <pre>
  sql.query("select * from PERSON where firstname like 'S%'") { ResultSet rs ->
  while (rs.next()) println rs.getString('firstname') + ' ' + rs.getString(3)
  }
  
  sql.query("call get_people_places()") { ResultSet rs ->
  while (rs.next()) println rs.toRowResult().firstname
  }
  </pre>
  <p>
  All resources including the ResultSet are closed automatically
  after the closure is called.
  
  @param sql     the sql statement
  @param closure called for each row with a GroovyResultSet
  @throws SQLException if a database access error occurs