import org.gxos.Defaults; import org.gxos.DatabaseManager; import org.gxos.xml.Database; import org.gxos.xml.XMLException; import org.gxos.xml.XMLObject; import org.gxos.Users; import commgrids.schema.User; public class TestDB2 { public static void main(String[] args) { // if no path is specified, it is assumed to be in the classpath. String configFile = "c:\\gxos\\lib\\gxosconfig.xml"; try { if(args.length > 0) // config file can be the first parameter. configFile = args[0]; DatabaseManager.initialize( Defaults.getXMLConfiguration(configFile) ); XMLObject db = DatabaseManager.getDatabase("gxos://okctest"); XMLObject users = db.getChild("Users"); User john = (User)Users.constructUser(new User(), "jmdoe", // user id "qww2223", // passwd "John M Doe", // full name "", "", // prefixes and suffixes if any, i.e. Mr, Jr "jmdoe@indiana.edu"); // email users.addObject(john); } catch(Exception e) { e.printStackTrace(); } } }