use of org.apache.ignite.internal.processors.odbc.jdbc.JdbcQueryFetchResult in project ignite by apache.
the class JdbcThinResultSet method next.
/**
* {@inheritDoc}
*/
@Override
public boolean next() throws SQLException {
ensureAlive();
if ((rowsIter == null || !rowsIter.hasNext()) && !finished) {
JdbcQueryFetchResult res = stmt.conn.sendRequest(new JdbcQueryFetchRequest(cursorId, fetchSize), stmt, stickyIO).response();
rows = res.items();
finished = res.last();
rowsIter = rows.iterator();
}
if (rowsIter != null) {
if (rowsIter.hasNext()) {
curRow = rowsIter.next();
curPos++;
return true;
} else {
rowsIter = null;
curRow = null;
return false;
}
} else
return false;
}
Aggregations