如何在OrientDB中使用Java删除远程图形

如何在OrientDB中使用Java删除远程图形,java,orientdb,Java,Orientdb,我正在尝试设置一个远程OrientDB服务器,并尝试从本地Java代码将顶点输入其中 当我尝试以下代码时: private static final void dropDb() { OrientGraphNoTx graph = new OrientGraphNoTx(ORIENT_URL); graph.drop(); } 我得到一个例外,说: Exception in thread "main" com.orientechnologies.orient.core.excep

我正在尝试设置一个远程OrientDB服务器,并尝试从本地Java代码将顶点输入其中

当我尝试以下代码时:

private static final void dropDb() {
    OrientGraphNoTx graph = new OrientGraphNoTx(ORIENT_URL);
    graph.drop();
}
我得到一个例外,说:

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.
如何使用Java在OrientDB中删除远程图形?

jackofblades

图表回答了您的问题:

请使用控制台或OServerAdmin类

这是从页面上取下来的

帕特里克

他是一个笨手笨脚的家伙

图表回答了您的问题:

请使用控制台或OServerAdmin类

这是从页面上取下来的

帕特里克

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