xsqlvar.sqldata = new Double(0); db.out.writeDouble(((Double) xsqlvar.sqldata).doubleValue());
xsqlvar.sqldata = XSQLVAR.encodeDouble(0); db.out.write(xsqlvar.sqldata);
    private void writeSQLData(isc_db_handle_impl db,                                 XSQLDA xsqlda) throws GDSException {        // This only works if not (port->port_flags & PORT_symmetric)        for (int i = 0; i < xsqlda.sqld; i++) {            XSQLVAR xsqlvar = xsqlda.sqlvar[i];            if (log != null) {                if (db.out == null) {                    log.debug("db.out null in writeSQLDatum");                }                if (xsqlvar.sqldata == null) {                    log.debug("sqldata null in writeSQLDatum: " + xsqlvar);                }                if (xsqlvar.sqldata == null) {                    log.debug("sqldata still null in writeSQLDatum: " + xsqlvar);                }            }            try {                int indNull = 0;                if (xsqlvar.sqldata == null)                    indNull = -1;                switch (xsqlvar.sqltype & ~1) {                    case SQL_TEXT:                        if (xsqlvar.sqldata == null)                            xsqlvar.sqldata = new byte[xsqlvar.sqllen];                        db.out.writeChar((byte[])xsqlvar.sqldata, xsqlvar.sqllen);                        break;                    case SQL_VARYING:                        if (xsqlvar.sqldata == null)                            xsqlvar.sqldata = new byte[0];                        db.out.writeBuffer((byte[])xsqlvar.sqldata, ((byte[])xsqlvar.sqldata).length);                            break;                    case SQL_SHORT:                        if (xsqlvar.sqldata == null)                            xsqlvar.sqldata = new Short((short)0);                        db.out.writeInt(((Short) xsqlvar.sqldata).shortValue());                        break;                    case SQL_LONG:                        if (xsqlvar.sqldata == null)                            xsqlvar.sqldata = new Integer(0);                        db.out.writeInt(((Integer) xsqlvar.sqldata).intValue());                        break;                    case SQL_FLOAT:                        if (xsqlvar.sqldata == null)                            xsqlvar.sqldata = new Float(0);                        db.out.writeFloat(((Float) xsqlvar.sqldata).floatValue());                        break;                    case SQL_DOUBLE:                        if (xsqlvar.sqldata == null)                            xsqlvar.sqldata = new Double(0);                        db.out.writeDouble(((Double) xsqlvar.sqldata).doubleValue());                        break;//                case SQL_D_FLOAT://                    break;                    case SQL_TIMESTAMP:                        if (xsqlvar.sqldata == null)                            xsqlvar.sqldata = new java.sql.Timestamp(0);                        db.out.writeInt(encodeDate((java.sql.Timestamp) xsqlvar.sqldata));                        db.out.writeInt(encodeTime((java.sql.Timestamp) xsqlvar.sqldata));                        break;                    case SQL_BLOB:                    case SQL_ARRAY:                    case SQL_QUAD:                    case SQL_INT64:                        if (xsqlvar.sqldata == null)                            xsqlvar.sqldata = new Long(0);                        db.out.writeLong(((Long) xsqlvar.sqldata).longValue());                        break;                    case SQL_TYPE_TIME:                        if (xsqlvar.sqldata == null)                            xsqlvar.sqldata = new java.sql.Time(0);                        db.out.writeInt(encodeTime((java.sql.Time) xsqlvar.sqldata));                        break;                    case SQL_TYPE_DATE:                        if (xsqlvar.sqldata == null)                            xsqlvar.sqldata = new java.sql.Date(0);                        db.out.writeInt(encodeDate((java.sql.Date) xsqlvar.sqldata));                        break;                    default:                        throw new GDSException("Unknown sql data type: " + xsqlvar.sqltype);                }                db.out.writeInt(indNull);            } catch (IOException ex) {                throw new GDSException(isc_net_write_err);            }		  }    }