![]() |
![]() |
[ Bottom of Page | Previous Page | Next Page | Contents ]
The following examples indicate how you use the classes to work with objects in the database:
//Object definition String wksName = "MYWS"; Workstation wks = new Workstation(); wks.setName(wksName); wks.setType(WorkstationType.FTA); wks.setOs(OperatingSystem.UNIX); wks.setAutoLink(true); wks.setNodeName("node.ibm.com"); wks.setSecurityLevel(SecurityLevel.NONE); ConnModel myModel; //Get an instance of ConnModel interface... ... //Add the object try { myModel.addTWSObject(wks, null); } catch (ConnException e) { //Do something to recover... }
Workstation wksRead = new Workstation(); //Get the same workstation from the DB try { wksRead = (Workstation) myModel.getTWSObject(Workstation.class, new FlowTargetKey(wksName), false, null); } catch (ConnException e) { //Do something to recover... }
//Remove a workstation from the DB try { myModel.removeTWSObject(Workstation.class, wksRead.getId(), null); } catch (ConnException exc) { //Do something to recover... }
[ Top of Page | Previous Page | Next Page | Contents ]