code: public boolean getMoreResults(final int current, Protocol protocol) throws SQLException {
      if (fetchSize != 0 && resultSet != null) {
  
        protocol.getLock().lock();
        try {
          //load current resultSet
          if (current == Statement.CLOSE_CURRENT_RESULT && resultSet != null) {
            resultSet.close();
          } else {
            resultSet.fetchRemaining();
          }
  
          //load next data if there is
          if (protocol.hasMoreResults()) {
            protocol.getResult(this);
          }
  
        } catch (SQLException e) {
          ExceptionMapper.throwException(e, null, statement);
        } finally {
          protocol.getLock().unlock();
        }
  
      }
  
      if (cmdInformation.moreResults() && !batch) {
  
        if (current == Statement.CLOSE_CURRENT_RESULT && resultSet != null) {
          resultSet.close();
        }
        if (executionResults != null) {
          resultSet = executionResults.poll();
        }
        return resultSet != null;
  
      } else {
  
        if (current == Statement.CLOSE_CURRENT_RESULT && resultSet != null) {
          resultSet.close();
        }
        resultSet = null;
        return false;
  
      }
  
    }
docs: Position to next resultSet.
  
  @param current  one of the following <code>Statement</code> constants indicating what should
  happen to current
  <code>ResultSet</code> objects obtained using the method
  <code>getResultSet</code>:
  <code>Statement.CLOSE_CURRENT_RESULT</code>, <code>Statement.KEEP_CURRENT_RESULT</code>,
  or <code>Statement.CLOSE_ALL_RESULTS</code>
  @param protocol current protocol
  @return true if other resultSet exists.
  @throws SQLException if any connection error occur.