@Override
  public void beforeFirst() throws SQLException {
    if (isClosed) {
      throw new SQLException("Resultset is closed");
    }
    if (!isScrollable) {
      throw new SQLException("Method not supported for TYPE_FORWARD_ONLY resultset");
    }

    // If we are asked to start from begining, clear the current fetched resultset
    shutdownPool();
    initEmptyIterator();
    orientation = TFetchOrientation.FETCH_FIRST;
    rowsFetched = 0;
    nextStartRow.set(1L);
    fetchDone = false;
    poolDone.set(false);
    gotLastBatch.set(false);
  }
Moves the cursor before the first row of the resultset.

@see java.sql.ResultSet#next()
@throws SQLException
          if a database access error occurs.
jdbc/src/java/org/apache/hive/jdbc/HiveQueryResultSet.java