Exemplo n.º 1
0
  @Override
  public final Result<R> fetch(int number) {
    // [#1157] This invokes listener.fetchStart(ctx), which has to be called
    // Before listener.resultStart(ctx)
    iterator();

    ResultImpl<R> result = new ResultImpl<R>(ctx.configuration(), fields);
    R record = null;

    ctx.result(result);
    listener.resultStart(ctx);

    for (int i = 0; i < number && ((record = iterator().next()) != null); i++) {
      result.addRecord(record);
    }

    ctx.result(result);
    listener.resultEnd(ctx);

    return result;
  }
Exemplo n.º 2
0
 @Override
 public final ResultSet intoResultSet() {
   ResultImpl<Record> result = new ResultImpl<Record>(configuration(), fields.fields.fields);
   result.add(this);
   return result.intoResultSet();
 }