nextOperation(db);
do { op = nextOperation(db); if (op==op_response) { receiveResponse(db, op); continue; } } while (false);
    public void isc_dsql_fetch(isc_stmt_handle stmt_handle,                              int da_version,                              XSQLDA xsqlda, int fetchSize) throws GDSException {        boolean debug = log != null && log.isDebugEnabled();        isc_stmt_handle_impl stmt = (isc_stmt_handle_impl) stmt_handle;        isc_db_handle_impl db = stmt.getRsr_rdb();        if (stmt_handle == null) {            throw new GDSException(ISCConstants.isc_bad_req_handle);        }        if (xsqlda == null) {            throw new GDSException(ISCConstants.isc_dsql_sqlda_err);        }        if (fetchSize <= 0) {            throw new GDSException(ISCConstants.isc_dsql_sqlda_err);        }        // Apply fetchSize        synchronized (db) {            XdrOutputStream out = db.out;            XdrInputStream in = db.in;            try {                    //Fetch next batch of rows                    stmt.ensureCapacity(fetchSize);                    if (debug) log.debug("op_fetch ");                    out.writeInt(op_fetch);                    out.writeInt(stmt.getRsr_id());                    out.writeBuffer(xsqlda.blr);                    out.writeInt(0);              // p_sqldata_message_number                    out.writeInt(fetchSize); // p_sqldata_messages                    out.flush();                                if (debug) log.debug("sent");                    int op = nextOperation(db);                    if (op == op_fetch_response) {                        int sqldata_status;                        int sqldata_messages;                        do {                            sqldata_status = in.readInt();                            sqldata_messages = in.readInt();                            if (sqldata_messages > 0 && sqldata_status == 0) {                                in.readSQLData(xsqlda.ioLength,stmt);                                nextOperation(db);                            }                        } while (sqldata_messages > 0 && sqldata_status == 0);                        if (sqldata_status == 100) {                            if (debug) log.debug("all rows successfully fetched");                            stmt.setAllRowsFetched(true);                        }                    }                    else {                        receiveResponse(db,op);                    }            } catch (IOException ex) {                throw new GDSException(ISCConstants.isc_net_read_err);            }        }    }