cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Create embedded database on Neo4j 4.0.2

Im doing a migration from Neo4j 3 to 4, and Im stuck at the following problem:

Before, I had this line to create an embedded database:
service = new GraphDatabaseFactory().newEmbeddedDatabase(dir);

Now, I can't find a similar substitute for it.
What is the correct way to create a embedded database on Neo4j 4.0.2?

1 REPLY 1

It is described here: https://neo4j.com/docs/java-reference/current/java-embedded/include-neo4j/#tutorials-java-embedded-s...

DatabaseManagementService managementService = new DatabaseManagementServiceBuilder(databaseDirectory).build();
GraphDatabaseService graphDb = managementService.database(DEFAULT_DATABASE_NAME);

This should work.

Personally I'm struggling with the way to activate the http-console, because it should work with the following snippet (but it does not work)

DatabaseManagementService managementService = new DatabaseManagementServiceBuilder(databaseDirectory)
.setConfig(HttpConnector.enabled, true)
.build();