// -------------------------------------------------------------------
  void extractFromByteArray(LogicalByteArray buf, String addr, InterfaceConnection ic)
      throws CharacterCodingException, UnsupportedCharsetException, SQLException {
    exception_nr = buf.extractInt();
    exception_detail = buf.extractInt();

    String temp0 = Integer.toString(exception_nr);
    String temp1 = Integer.toString(exception_detail);

    switch (exception_nr) {
      case TRANSPORT.CEE_SUCCESS:
        break;
      case odbc_SQLSvc_Close_SQLError_exn_:
        SQLError = new ERROR_DESC_LIST_def();
        SQLError.extractFromByteArray(buf, ic);
        break;
      case odbc_SQLSvc_Close_ParamError_exn_:
        ParamError = ic.decodeBytes(buf.extractString(), 1);
        ;
        throw TrafT4Messages.createSQLException(
            null, ic.getLocale(), "ids_program_error", ParamError, addr);
      case odbc_SQLSvc_Close_InvalidConnection_exn_:
        throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
      case odbc_SQLSvc_Close_TransactionError_exn_:
        throw TrafT4Messages.createSQLException(
            null, ic.getLocale(), "ids_transaction_error", temp1, addr);
      default:
        throw TrafT4Messages.createSQLException(
            null, ic.getLocale(), "ids_unknown_reply_error", temp0, temp1);
    }
  }
  // ----------------------------------------------------------
  int sizeOf(InterfaceConnection ic) throws CharacterCodingException, UnsupportedCharsetException {
    int size = 0;

    datasourceBytes = ic.encodeString(datasource, InterfaceUtilities.SQLCHARSETCODE_UTF8);
    catalogBytes = ic.encodeString(catalog, InterfaceUtilities.SQLCHARSETCODE_UTF8);
    schemaBytes = ic.encodeString(schema, InterfaceUtilities.SQLCHARSETCODE_UTF8);
    locationBytes = ic.encodeString(location, 1);
    userRoleBytes = ic.encodeString(userRole, 1);
    computerNameBytes = ic.encodeString(computerName, InterfaceUtilities.SQLCHARSETCODE_UTF8);
    windowTextBytes = ic.encodeString(windowText, InterfaceUtilities.SQLCHARSETCODE_UTF8);
    connectOptionsBytes = ic.encodeString(connectOptions, 1);

    size = TRANSPORT.size_bytes(datasourceBytes);
    size += TRANSPORT.size_bytes(catalogBytes);
    size += TRANSPORT.size_bytes(schemaBytes);
    size += TRANSPORT.size_bytes(locationBytes);
    size += TRANSPORT.size_bytes(userRoleBytes);

    size += TRANSPORT.size_short; // accessMode
    size += TRANSPORT.size_short; // autoCommit
    size += TRANSPORT.size_int; // queryTimeoutSec
    size += TRANSPORT.size_int; // idleTimeoutSec
    size += TRANSPORT.size_int; // loginTimeoutSec
    size += TRANSPORT.size_short; // txnIsolationLevel
    size += TRANSPORT.size_short; // rowSetSize

    size += TRANSPORT.size_short; // diagnosticFlag
    size += TRANSPORT.size_int; // processId

    size += TRANSPORT.size_bytes(computerNameBytes);
    size += TRANSPORT.size_bytes(windowTextBytes);

    size += TRANSPORT.size_int; // ctxACP
    size += TRANSPORT.size_int; // ctxDataLang
    size += TRANSPORT.size_int; // ctxErrorLang
    size += TRANSPORT.size_short; // ctxCtrlInferNCHAR

    size += TRANSPORT.size_short; // cpuToUse
    size += TRANSPORT.size_short; // cpuToUseEnd
    size += TRANSPORT.size_bytes(connectOptionsBytes);

    size += clientVersionList.sizeOf();

    return size;
  }