How to drop a remote graph using Java in OrientDB

限于喜欢 提交于 2019-12-13 04:59:53

问题


I am trying to setup a remote OrientDB Server and I am trying to enter vertices into it from local Java code.

When I try the following code:

private static final void dropDb() {
    OrientGraphNoTx graph = new OrientGraphNoTx(ORIENT_URL);
    graph.drop();
}

I get an Exception saying:

Exception in thread "main" com.orientechnologies.orient.core.exception.ODatabaseException: Cannot delete database
...
Caused by: java.lang.UnsupportedOperationException: Cannot delete a database in a remote server. Please use the console or the OServerAdmin class.

How do I go about deleting a remote graph, using Java, in OrientDB?


回答1:


He jackofblades,

the Graph answers your question:

Please use the console or the OServerAdmin class

// CREATE A SERVER ADMIN CLIENT AGAINST A REMOTE SERVER
OServerAdmin serverAdmin = new OServerAdmin("remote:localhost/GratefulDeadConcerts").connect("admin", "admin");
serverAdmin.dropDatabase("GratefulDeadConcerts");

This is taken from the OrientDB Wiki Page

Patrick



来源:https://stackoverflow.com/questions/26485074/how-to-drop-a-remote-graph-using-java-in-orientdb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!