Note: I found many tutorials online and found that they were not suitable for users with 0 basics, so I wrote them myself.
The recommended version is, and a large number of functions have been abandoned after testing 2.3.3.
Installation start
- Download the tar package on the official website
- Unzip, enter bin, and run ./neo4j
- Open localhost:7474 in url and use
Configuration
The location settings of the database.
Line 14 in conf/org.=Make modifications
use
The tool for visualizing neo4j is webadmin. Open the method: open local/webadmin in url and you can use it
Note: The code changes the database, and it seems that neo4j is required to be restarted every time to display in webadmin. It may also be that the data synchronization is slow.
2. Simple instance (java operation neo4j)
package neo4j; import ; import ; import ; import org.; import org.; import org.; import org.; import org.; import org.; import org.; public class test { public enum RelTypes implements RelationshipType{ KNOWS } private static void registerShutdownHook( final GraphDatabaseService graphDb ) { // Registers a shutdown hook for the Neo4j instance so that it // shuts down nicely when the VM exits (even if you "Ctrl-C" the // running example before it's completed) /*To ensure the correct shutdown of the neo4j database, we can add a close hook method * registerShutdownHook. This method means adding a closed one in jvm * Hook, when jvm is closed, all the methods that have been set in the system will be executed * AddShutdownHook hooks, jvm will be closed only after the system has executed these hooks. * So these hooks can perform memory cleaning, object destruction and other operations when jvm is closed. */ ().addShutdownHook( new Thread() { @Override public void run() { (); } } ); } public static void main(String[] args) throws IOException { ( new File( "db" ) ); GraphDatabaseService graphdb=new GraphDatabaseFactory().newEmbeddedDatabase("db"); Relationship relationship; Transaction tx=(); try{ Node node1=(); Node node2=(); ("message", "Hello"); ("message", "World"); relationship = (node2, ); ("message", "brave neo4j"); (); ("successfully"); } finally{ (); } registerShutdownHook(graphdb); } }
The above is all the content of this article. I hope it will be helpful to everyone's study and I hope everyone will support me more.