Versant数据库可以很容易的建立和数据库之间的连接:
Iterator<DatabaseLoginHelper> ite = this.dblist.iterator();
DatabaseLoginHelper helper = (DatabaseLoginHelper)ite.next();
session = new TransSession(helper.getDatabaseNodeProperty());
session.setSchemaOption(TransSession.SCHEMA_ADD_DROP_ATTRIBUTES);
// System.out.println("Define Logical database:");
session.newLogicalDatabase(HPC_DEMO_NETWORK_NAME);
// System.out.println("Add to logical database:"+dbList[0]);
session.addToLogicalDatabase(HPC_DEMO_NETWORK_NAME, helper.databaseName);
System.out.println("Add to logical database:" + helper.databaseName);
Iterator<DatabaseLoginHelper> ite = this.dblist.iterator();
DatabaseLoginHelper helper = (DatabaseLoginHelper)ite.next();
session = new TransSession(helper.getDatabaseNodeProperty());
session.setSchemaOption(TransSession.SCHEMA_ADD_DROP_ATTRIBUTES);
// System.out.println("Define Logical database:");
session.newLogicalDatabase(HPC_DEMO_NETWORK_NAME);
// System.out.println("Add to logical database:"+dbList[0]);
session.addToLogicalDatabase(HPC_DEMO_NETWORK_NAME, helper.databaseName);
System.out.println("Add to logical database:" + helper.databaseName);
本文详细介绍了使用Versant数据库建立连接并定义逻辑数据库的过程,包括使用Iterator获取数据库列表,通过DatabaseLoginHelper获取数据库节点属性,创建事务会话,并添加到逻辑数据库中。
1053

被折叠的 条评论
为什么被折叠?



