ADK Programming
ADK Programming
ADK Programming
Context; import matrix.db.RelationshipType; import matrix.util.MatrixException; public class ConnectDatabase { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub try { @SuppressWarnings("deprecation") Context conObj = new Context(":bos","http://localhost:8080/enovia/"); conObj.setUser("creator"); conObj.setPassword(""); conObj.connect(); System.out.println("connected ..............."); DomainObject dobj=new DomainObject(); DomainObject dobj1=new DomainObject(); dobj.createObject(conObj,"Micro Computer","MC","A","ComputerPolicy","ComputerVault"); dobj1.createAndConnect(conObj,"System Box","SB","A","ComputerPolicy","ComputerVault","MicrocomputerAssembly",dobj,true); dobj1.createAndConnect(conObj,"Mouse","Mouse","A","ComputerPolicy","ComputerVault","Microcom puterAssembly",dobj,true); dobj1.createAndConnect(conObj,"Monitor","Monitor","A","ComputerPolicy","ComputerVault","Microc omputerAssembly",dobj,true); dobj1.createAndConnect(conObj,"Keyboard","KB","A","ComputerPolicy","ComputerVault","Microcomp uterAssembly",dobj,true); //findAndUpdateHighImpactProjects(context); conObj.disconnect(); } catch (MatrixException e) { // TODO Auto-generated catch block e.printStackTrace();
} } }