if (log.isDebugEnabled()) {log.debug("op_connect ");}
log.debug("op_connect ");
    private void connect(isc_db_handle_impl db,                            DbAttachInfo dbai) throws GDSException {        try {            try {                db.socket = new Socket(dbai.getServer(), dbai.getPort());                if (log.isDebugEnabled()) {log.debug("Got socket");}            } catch (UnknownHostException ex2) {                throw new GDSException("Can't get socket: " + ex2);            }            db.out = new XdrOutputStream(new BufferedOutputStream(db.socket.getOutputStream()));            db.in = new XdrInputStream(new BufferedInputStream(db.socket.getInputStream()));            //Here we identify the user to the engine.  This may or may not be used             //as login info to a database.            String user = System.getProperty("user.name");            if (log.isDebugEnabled()) {log.debug("user.name: " + user);}            String host = InetAddress.getLocalHost().getHostName();            byte[] user_id = new byte[200];            int n = 0;            user_id[n++] = 1;   // CNCT_user            user_id[n++] = (byte) user.length();            System.arraycopy(user.getBytes(), 0, user_id, n, user.length());            n += user.length();            /*            String passwd = "masterkey";            user_id[n++] = 2;   // CNCT_passwd            user_id[n++] = (byte) passwd.length();            System.arraycopy(passwd.getBytes(), 0, user_id, n, passwd.length());            n += passwd.length();*/            user_id[n++] = 4;     // CNCT_host            user_id[n++] = (byte) host.length();            System.arraycopy(host.getBytes(), 0, user_id, n, host.length());            n += host.length();                        user_id[n++] = 6;     // CNCT_user_verification            user_id[n++] = 0;            if (log.isDebugEnabled()) {log.debug("op_connect ");}            db.out.writeInt(op_connect);            db.out.writeInt(op_attach);            db.out.writeInt(2);                    // CONNECT_VERSION2            db.out.writeInt(1);                    // arch_generic//            db.out.writeString(file_name);        // p_cnct_file            db.out.writeString(dbai.getFileName());        // p_cnct_file            db.out.writeInt(1);                   // p_cnct_count            db.out.writeBuffer(user_id, n);       // p_cnct_user_id//            db.out.writeInt(0);                   // p_cnct_user_id            db.out.writeInt(10);                   // PROTOCOL_VERSION10            db.out.writeInt(1);                    // arch_generic            db.out.writeInt(2);                    // ptype_rpc            db.out.writeInt(3);                    // ptype_batch_send            db.out.writeInt(2);            db.out.flush();                        if (log.isDebugEnabled()) {log.debug("sent");}            if (log.isDebugEnabled()) {log.debug("op_accept ");}            if (readOperation(db) == op_accept) {                db.in.readInt();                   // Protocol version number                db.in.readInt();                   // Architecture for protocol                db.in.readInt();                   // Minimum type                if (log.isDebugEnabled()) {log.debug("received");}            } else {                disconnect(db);                if (log.isDebugEnabled()) {log.debug("not received");}                throw new GDSException(isc_connect_reject);            }        } catch (IOException ex) {            log.info("IOException while trying to connect to db:", ex);            throw new GDSException(isc_network_error);        }    }