全部the documentation I see谈论对象持久性。这很好,但我需要能够直接访问全局变量(比如 ^SE("stackoverflow","q",34241364,"md")
)。
如何做到这一点?
最佳答案
是的,可以使用 Java eXTreme 库 (cacheextreme.jar) 提供的 Globals API。参见 documentation .结束示例:
import com.intersys.globals.*;
class FetchNodes {
public static void main(String[] args) {
Connection myConn = ConnectionContext.getConnection();
try {
myConn.connect("User", "_SYSTEM", "SYS");
NodeReference nodeRef = myConn.createNodeReference("myGlobal");
// Read both existing nodes
System.out.println("Value of ^myGlobal is " + nodeRef.getString());
System.out.println("Value of ^myGlobal(\"sub1\") is " + nodeRef.getString("sub1"));
nodeRef.kill(); // delete entire array
nodeRef.close();
myConn.close();
}
catch (GlobalsException e) { System.out.println(e.getMessage()); }
} // end Main()
} // end class FetchNodes
关于java - 如何使用 Java 互操作直接访问全局变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34241364/