gpt4 book ai didi

java - OrientDB 无法使用远程从 Java 获取图形实例

转载 作者:行者123 更新时间:2023-11-29 03:00:54 25 4
gpt4 key购买 nike

我创建了一个名为“testing”的数据库并启动了服务器,但是当我尝试使用“远程”从它获取图形实例时......

OrientGraphFactory factory = new OrientGraphFactory("REMOTE:localhost:2424/testing", "admin", "admin");
OrientGraph txGraph = factory.getTx(); <--- THIS LINE

...它给出了这个错误信息:

Exception in thread "main" java.lang.UnsupportedOperationException: Cannot check the existance of a database in a remote server. Please use the console or the OServerAdmin class. at com.orientechnologies.orient.client.remote.OStorageRemote.exists(OStorageRemote.java:282) at com.orientechnologies.orient.client.remote.OStorageRemoteThread.exists(OStorageRemoteThread.java:170) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.exists(ODatabaseDocumentTx.java:1160) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.openOrCreate(OrientBaseGraph.java:1902) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.(OrientBaseGraph.java:181) at com.tinkerpop.blueprints.impls.orient.OrientTransactionalGraph.(OrientTransactionalGraph.java:102) at com.tinkerpop.blueprints.impls.orient.OrientTransactionalGraph.(OrientTransactionalGraph.java:98) at com.tinkerpop.blueprints.impls.orient.OrientGraph.(OrientGraph.java:77) at testing.testing.main(testing.java:202)

OServerAdmin 类也不提供任何实用程序来获取图形实例。

在 OrientDB v2.1.9 上测试

知道如何解决这个问题吗?

最佳答案

如果你想在远程模式下打开一个数据库,你必须使用 OServerAdmin 类,然后你可以使用 OrientGraphFactory。我附上了一个例子。

enter image description here

关于java - OrientDB 无法使用远程从 Java 获取图形实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35053001/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com