简体   繁体   中英

How to drop a remote graph using Java in OrientDB

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM