Database Reference
In-Depth Information
inDef.drop();
}
For compiling and running each of the preceding code snippets, perform the following
steps and execute it from the IDE itself. You should now see that indexes are being cre-
ated/listed/dropped on the
Movies
label:
1. Stop your Neo4j server (if it is already running).
2. Provide all JAR files from
<$NEO4J_HOME>/lib
/ in the classpath.
3. Apart from
org.neo4j.graphdb.*
and
org.neo4j.graphdb.factory.*
add or import
org.neo4j.graphdb.schema.*
as an additional package.
4. Wrap the code around the transaction in a try and catch block:
try (Transac-
tion tx = graphDb.beginTx()) {}
.
try-with-resources
is
available only with Java 1.7 and above.
5. Initialize the Java variable
DBLocation
with the location of your Neo4j data-
base as per your local filesystem, which is generally available at
<$NEO4J_HOME>/data/graph.db
.
Note
Updating / Inserting data is an automatic process, so there are no APIs that provide opera-
tions for updating or inserting data.