public void drop() { if (factory.exists(dbName)) { factory.drop(dbName); } factory.close(); }
@ConsoleCommand(description = "Delete the current database", onlineHelp = "Console-Command-Drop-Database") public void dropDatabase( @ConsoleParameter(name = "storage-type", description = "Storage type of server database", optional = true) String storageType) throws IOException { checkForDatabase(); final String dbName = currentDatabase.getName(); currentDatabase.close(); if (storageType != null && !"plocal".equalsIgnoreCase(storageType)&& !"local".equalsIgnoreCase(storageType)&& !"memory".equalsIgnoreCase(storageType)) { message("\n\nInvalid storage type for db: '" + storageType + "'"); return; } orientDB.drop(dbName); currentDatabase = null; currentDatabaseName = null; message("\n\nDatabase '" + dbName + "' deleted successfully"); }