cancel
Showing results for 
Search instead for 
Did you mean: 

How to use APOC in java

yunzhoun
Node Link

Hi guys,

I'm currently learning neo4j and trying to use APOC library in my java project. Specifically, I'd like to build a application that can use APOC's functionality to do batch update to my graph.

However, I don't know how to use APOC in Java. I have read this article:Using APOC Procedures on an Embedded Database from Java, but it seems like I'm using a "normal" deployment which is different from this topic holder.

So my question is:

  1. Do I have to add more dependencies to my pom file? If yes, what are they?
  2. Now I only know how to use session.run() to execute cypher query in java. To use APOC, what I should do? A code snippet will be well appreciated. For example, just use "CALL apoc.create.node()" to create a node with some properties and label.

Thank you so much!

1 ACCEPTED SOLUTION

As you are connecting to a Neo4j server via the driver, you have to install APOC on the server.

And then you can just call them like any other Cypher statement.

If you have full control of your connection and data, in most cases you don't need the apoc procedures just call the appropriate Cypher instead. E.g. CREATE (n:Node {name:$name}) etc

View solution in original post

4 REPLIES 4

yunzhoun
Node Link

Can anybody help? There's no material I can find to walk me through.

terryfranklin82
Graph Voyager

Does anything here help?

As you are connecting to a Neo4j server via the driver, you have to install APOC on the server.

And then you can just call them like any other Cypher statement.

If you have full control of your connection and data, in most cases you don't need the apoc procedures just call the appropriate Cypher instead. E.g. CREATE (n:Node {name:$name}) etc

Hi Michael,

Thank you very much for the answer, it worked!