public static final void exampleConnectingToCyc() {
    System.out.println("Starting Cyc connection examples.");
    try {
      System.out.println("Successfully established CYC access " + access);

      // The following code should only be called if you will be modifying the KB
      // and one should typically use a real user and more specific KE purpose.
      // This information is used for accurately maintaining KB content
      // bookkeeping information.
      CycConstant cycAdministrator = access.getKnownConstantByName("CycAdministrator");
      CycConstant generalCycKE = access.getKnownConstantByName("GeneralCycKE");
      access.setCyclist(cycAdministrator);
      access.setKePurpose(generalCycKE);

      // Do stuff with the connection here.

      // Note: The class CycAccess contains many of the
      // useful public methods for interacting with Cyc.

      // Note: Establishing a connection with Cyc is relatively expensive.
      // If you have a lot of work to do with Cyc over time, make a single
      // CycAccess object and use that everywhere.
    } catch (UnknownHostException nohost) {
      // if cyc server host not found on the network
      nohost.printStackTrace();
    } catch (IOException io) {
      // if a data communication error occurs
      io.printStackTrace();
    } catch (CycApiException cyc_e) {
      // if the api request results in a cyc server error
      // example: cannot launch servicing thread;
      // protocol errors, etc.
      cyc_e.printStackTrace();
    } catch (Exception e) {
      e.printStackTrace();
    }
    System.out.println("Finished.");
  }