} catch (IOException ex) { throw new GDSException(isc_net_read_err); }
} catch (IOException ex) { throw new GDSException(isc_net_read_err);
    public void isc_dsql_fetch(isc_stmt_handle stmt_handle,                              int da_version,                              XSQLDA xsqlda) throws GDSException {        isc_stmt_handle_impl stmt = (isc_stmt_handle_impl) stmt_handle;        isc_db_handle_impl db = stmt.rsr_rdb;        if (stmt_handle == null) {            throw new GDSException(isc_bad_req_handle);        }        if (xsqlda == null) {            throw new GDSException(isc_dsql_sqlda_err);        }        if (!stmt.allRowsFetched && stmt.rows.size() == 0) {            //Fetch next batch of rows            synchronized (db) {                try {                    if (log != null) log.debug("op_fetch ");                    db.out.writeInt(op_fetch);                    db.out.writeInt(stmt.rsr_id);                    writeBLR(db, xsqlda);                    db.out.writeInt(0);              // p_sqldata_message_number                    db.out.writeInt(MAX_FETCH_ROWS); // p_sqldata_messages                    db.out.flush();                                if (log != null) log.debug("sent");                    if (nextOperation(db) == op_fetch_response) {                        int sqldata_status;                        int sqldata_messages;                        do {                            int op = readOperation(db);                            sqldata_status = db.in.readInt();                            sqldata_messages = db.in.readInt();                            if (sqldata_messages > 0 && sqldata_status == 0) {                                stmt.rows.add(readSQLData(db, xsqlda));                            }                        } while (sqldata_messages > 0 && sqldata_status == 0);                        if (sqldata_status == 100) {                            if (log != null) log.debug("all rows successfully fetched");                            stmt.allRowsFetched = true;                        }                    }                    else {                        receiveResponse(db);                    }                } catch (IOException ex) {                    throw new GDSException(isc_net_read_err);                }            }        }/*        if (stmt.rows.size() > 0) {            //Return next row from cache.            return (byte[][])stmt.rows.remove(0);        }        else {            return null; //no rows fetched        }*/    }