Error in Executing Neo4j Cypher Query (by Java) embedded mode

廉价感情. 提交于 2019-12-06 01:38:32

GraphDatabaseFactory.newEmbeddedDatabase() expects a File and not a String, see http://neo4j.com/docs/java-reference/current/javadocs/org/neo4j/graphdb/factory/GraphDatabaseFactory.html#newEmbeddedDatabase-java.io.File-

Also there's no need to use ExecutionEngine. Just do a graphDb.execute(<cypherString>). Note this applies to Neo4j >= 2.3.

Below code should work to fix the issue.

File storeFile = new File("C:/Users/dell/Documents/Neo4j");

GraphDatabaseService db= dbFactory.newEmbeddedDatabase(storeFile);

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