sbhatt
sbhatt

Reputation: 485

How do I (cypher) query Neo4j embedded graph database from java program for Neo4j 3.x?

Neo4j has grown a lot since I last used it (milestone 2.0 to 3.0). I wanted to use cypher from java program with embedded graph database (GraphDatabaseService).

I used to create an ExecutionEngine and go from there for this earlier.

It appears that now the preferred way is to use org.neo4j.driver.* for this purpose.

This bundle does not seem to be there in the libs I get from Neo4j 3.0.7.

Is there anyway I can execute cypher query for embedded graph database using java?

Upvotes: 0

Views: 634

Answers (2)

Vineeth
Vineeth

Reputation: 135

GraphDatabaseService has execute(...) function to run cyphers. https://neo4j.com/docs/java-reference/current/javadocs/org/neo4j/graphdb/GraphDatabaseService.html#execute-java.lang.String-

There are some examples on Neo4j's tutorial page. http://neo4j.com/docs/java-reference/current/#tutorials-java-embedded

Upvotes: 2

cybersam
cybersam

Reputation: 67044

You can execute Cypher using the Java API for an embedded neo4j DB. Refer to this section of the 3.0 docs for more info on this.

The beginning of that same section of the docs shows how to set up your development environment, including setting up the dependencies.

Upvotes: 1

Related Questions