Aqqqq
Aqqqq

Reputation: 848

Why is this sample code in java not working?

In the java section of this page: https://neo4j.com/blog/cypher-load-json-from-url/

The line

db.execute(query, singletonMap("json",json));

gives an error, that is The method execute(String, Map<String,Map>) is undefined for the type GraphDatabaseService.

There is no method named "execute" in the class GraphDatabaseService and I can not find the documentation regarding this class. Does anyone know what happeed?

Did the neo4j change its library and did not adjust the code accordingly or did I miss some library to download (I have downloaded neo4j-kernel-1.8.1.jar and neo4j-java-driver-1.1.0.sources.jar and added them to path)?

Upvotes: 2

Views: 188

Answers (1)

Philipp Merkle
Philipp Merkle

Reputation: 2615

Use Neo4j 2.2.0 or later.

The execute methods have been added to GraphDatabaseService with version 2.2.0.

Compare: Neo4J 2.2.0 versus Neo4J 2.1.8

Also note that GraphDatabaseService moved to neo4j-graphdb-api-x.y.z.jar in newer revisions whereas you find it in neo4j-kernel-x.y.z.jar for older revisions.

Upvotes: 1

Related Questions