// -------------------------------------------------------------------
  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);
    }
  }
  // ----------------------------------------------------------
  void insertIntoByteArray(LogicalByteArray buf) {
    buf.insertString(datasourceBytes);
    buf.insertString(catalogBytes);
    buf.insertString(schemaBytes);
    buf.insertString(locationBytes);
    buf.insertString(userRoleBytes);

    buf.insertShort(accessMode);
    buf.insertShort(autoCommit);
    buf.insertInt(queryTimeoutSec);
    buf.insertInt(idleTimeoutSec);
    buf.insertInt(loginTimeoutSec);
    buf.insertShort(txnIsolationLevel);
    buf.insertShort(rowSetSize);

    buf.insertInt(diagnosticFlag);
    buf.insertInt(processId);

    buf.insertString(computerNameBytes);
    buf.insertString(windowTextBytes);

    buf.insertInt(ctxACP);
    buf.insertInt(ctxDataLang);
    buf.insertInt(ctxErrorLang);
    buf.insertShort(ctxCtrlInferNXHAR);

    buf.insertShort(cpuToUse);
    buf.insertShort(cpuToUseEnd);
    buf.insertString(connectOptionsBytes);

    clientVersionList.insertIntoByteArray(buf);
  }