Reputation: 17
As far as I know there are 3 ways to run cypher query in with embedded java app.
org.neo4j.driver.Session session = GraphDatabase.driver(uri, AuthTokens.basic(user, password)).session().run(query)
src,chatgptnew GraphDatabaseFactory().newEmbeddedDatabase(STORE_DIR).execute(query)
src,Neo4j slow cypher query in embedded mode try (Transaction tx = graphDb.beginTx()) then org.neo4j.graphdb.Result result=tx.execute(query);
src,written by myself based on existing api,https://github.com/neo4j/neo4j/blob/5.6/community/graphdb-api/src/main/java/org/neo4j/graphdb/Transaction.javaSo the main question is
I believe some SO members might frown with 2 questions*.However I believed that the context is very important and it will clearly show my attempts and what I currently understood as.
Upvotes: 0
Views: 140
Reputation: 67019
You would use the neo4j Java API with an embedded neo4j DB, not the Java Driver API (which is only for accessing un-embedded DBs).
The correct way to use Cypher with an embedded DB is documented here.
Upvotes: 1