isc_tr_handle_impl tr = (isc_tr_handle_impl) tr_handle; isc_stmt_handle_impl stmt = (isc_stmt_handle_impl) stmt_handle; isc_db_handle_impl db = stmt.rsr_rdb;  if (tr_handle == null) { throw new GDSException(isc_bad_trans_handle); }  if (stmt_handle == null) { throw new GDSException(isc_bad_req_handle); }    stmt.in_sqlda = null; stmt.out_sqlda = null;  byte[] sql_prepare_info = new byte[] { isc_info_sql_select, isc_info_sql_describe_vars, isc_info_sql_sqlda_seq, isc_info_sql_type, isc_info_sql_sub_type, isc_info_sql_scale, isc_info_sql_length, isc_info_sql_field, isc_info_sql_relation, isc_info_sql_owner, isc_info_sql_alias, isc_info_sql_describe_end };  synchronized (db) { try { if (log != null) log.debug("op_prepare_statement "); db.out.writeInt(op_prepare_statement); db.out.writeInt(tr.getTransactionId()); db.out.writeInt(stmt.rsr_id); db.out.writeInt(dialect); db.out.writeString(statement); db.out.writeBuffer(sql_prepare_info, sql_prepare_info.length); db.out.writeInt(MAX_BUFFER_SIZE); db.out.flush();  if (log != null) log.debug("sent"); Response r = receiveResponse(db); stmt.out_sqlda = parseSqlInfo(stmt_handle, r.resp_data, sql_prepare_info); return stmt.out_sqlda; } catch (IOException ex) { throw new GDSException(isc_net_read_err); }   }
return isc_dsql_prepare(tr_handle, stmt_handle, statement, "NONE", dialect);
    public XSQLDA isc_dsql_prepare(isc_tr_handle tr_handle,                                isc_stmt_handle stmt_handle,                                String statement,                                int dialect/*,                                 xsqlda*/) throws GDSException {        isc_tr_handle_impl tr = (isc_tr_handle_impl) tr_handle;        isc_stmt_handle_impl stmt = (isc_stmt_handle_impl) stmt_handle;        isc_db_handle_impl db = stmt.rsr_rdb;        if (tr_handle == null) {            throw new GDSException(isc_bad_trans_handle);        }        if (stmt_handle == null) {            throw new GDSException(isc_bad_req_handle);        }        //reinitialize stmt SQLDA members.        stmt.in_sqlda = null;        stmt.out_sqlda = null;        byte[] sql_prepare_info = new byte[] { isc_info_sql_select,                                               isc_info_sql_describe_vars,                                               isc_info_sql_sqlda_seq,                                               isc_info_sql_type,                                               isc_info_sql_sub_type,                                               isc_info_sql_scale,                                               isc_info_sql_length,                                               isc_info_sql_field,                                               isc_info_sql_relation,                                               isc_info_sql_owner,                                               isc_info_sql_alias,                                               isc_info_sql_describe_end };        synchronized (db) {            try {                if (log != null) log.debug("op_prepare_statement ");                db.out.writeInt(op_prepare_statement);                db.out.writeInt(tr.getTransactionId());                db.out.writeInt(stmt.rsr_id);                db.out.writeInt(dialect);                db.out.writeString(statement);                db.out.writeBuffer(sql_prepare_info, sql_prepare_info.length);                db.out.writeInt(MAX_BUFFER_SIZE);                db.out.flush();                            if (log != null) log.debug("sent");                Response r = receiveResponse(db);                stmt.out_sqlda = parseSqlInfo(stmt_handle, r.resp_data, sql_prepare_info);                return stmt.out_sqlda;            } catch (IOException ex) {                throw new GDSException(isc_net_read_err);            }            // RSR_blob ??????????        }    }