Basic connection in Java to Matrix with attribute update (0)
February 27th, 2009 by Frank Niedermann, under Java, Matrix.
Connect to a Matrix database with Java
1 2 3 4 5 6 7 8 9 | Context context = new Context(""); context.setUser("creator"); context.setPassword("secret"); context.setVault("eService Production"); context.connect(); context.disconnect(); context.closeContext(); System.exit(0); |
Updating attributes for a Matrix object
1 2 3 4 5 6 7 8 9 | DomainObject do = new DomainObject(new BusinessObject("TYPE","NAME","REVISION","VAULT")); Map<String,String> m = new HashMap<String,String>(); m.put("Attribute1", "textOne"); m.put("Attribute2", "textTwo"); if (do.exists(context)) { do.setAttributeValues(context, m); } else { // object does not exist } |