public R fetch()

in old/dekaf-core/src/main/java/org/jetbrains/dekaf/jdbc/JdbcIntermediateCursor.java [258:284]


  public R fetch() {
    if (!myHasRows) {
      if (myResultLayout.kind == ResultLayout.Kind.EXISTENCE) {
        //noinspection unchecked
        return (R) Boolean.FALSE;
      }
      else {
        return null; // no more rows
      }
    }

    if (!myOpened) throw new IllegalStateException("The cursor is not opened or is yet closed.");

    final R result;
    try {
      result = myRowsCollector.collectRows(myResultSet, myCollectLimit);
    }
    catch (SQLException sqle) {
      close();
      throw mySeance.mySession.recognizeException(sqle, mySeance.myStatementText);
    }

    myHasRows = myRowsCollector.hasMoreRows;
    if (!myHasRows) close();

    return result;
  }