code: public boolean getMoreResults(int current) throws SQLException
    {
      // clean up current result, if exists
      if (resultSet != null &&
          (current == Statement.CLOSE_CURRENT_RESULT ||
           current == Statement.CLOSE_ALL_RESULTS))
      {
        resultSet.close();
      }
      resultSet = null;
  
      // verify if more results exist
      if (childResults == null || childResults.isEmpty())
      {
        return false;
      }
  
      // fetch next result using the query id
      SFChildResult nextResult = childResults.remove(0);
      try
      {
        JsonNode result = StmtUtil.getQueryResultJSON(
            nextResult.getId(), session);
        Object sortProperty = session.getSFSessionProperty("sort");
        boolean sortResult = sortProperty != null && (Boolean) sortProperty;
        resultSet = new SFResultSet(result, this, sortResult);
        // override statement type so we can treat the result set like a result of
        // the original statement called (and not the result scan)
        resultSet.setStatementType(nextResult.getType());
  
        return nextResult.getType().isGenerateResultSet();
      }
      catch (SFException ex)
      {
        throw new SnowflakeSQLException(ex);
      }
    }
docs: Sets the result set to the next one, if available.
  
  @param current What to do with the current result.
  One of Statement.CLOSE_CURRENT_RESULT,
  Statement.CLOSE_ALL_RESULTS, or
  Statement.KEEP_CURRENT_RESULT
  @return true if there is a next result and it's a result set
  false if there are no more results, or there is a next result
  and it's an update count
  @throws SQLException if something fails while getting the next result