Search in sources :

Example 1 with JdbcQueryFetchResult

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;
}
Also used : JdbcQueryFetchResult(org.apache.ignite.internal.processors.odbc.jdbc.JdbcQueryFetchResult) JdbcQueryFetchRequest(org.apache.ignite.internal.processors.odbc.jdbc.JdbcQueryFetchRequest)

Aggregations

JdbcQueryFetchRequest (org.apache.ignite.internal.processors.odbc.jdbc.JdbcQueryFetchRequest)1 JdbcQueryFetchResult (org.apache.ignite.internal.processors.odbc.jdbc.JdbcQueryFetchResult)1