I'm new to Neo4J and couldn't find the answer to my question despite my hours of googling.
So far, I have been following the tutorials and now I have a basic understanding of how/when to use Neo4j. Now, I am about to start modifying my hello-world code and connect to a Neo4J server locally installed on my machine, accessible via http://127.0.0.1:7474.
Original connection (using an embedded database):
GraphDatabaseService gdb = new EmbeddedGraphDatabase("c:\\helloworld\\data\\graph.db");
The question is is there anyway to modify this line to connect to my "server" database in c:\neo4j\data\graph.db instead? The server is running currently as a windows service and I can view its database using the web admin tool. At this time, I am not interested in using the REST API since the server and the client app are running on the same machine.
I feel like I'm missing something obvious here...
解决方案
The windows service exposes the REST interface.
The embedded interface is entirely different - you point it at the database file structure and then access it via Java method calls.
If you have both running at the same time, pointing at the same data, then bad things might happen (actually, I think it detects this and prevents it). So you probably need to stop the service and/or backup the data from this instance to another directory. Then edit your EmbeddedGraphDatabase constructor to point to this directory.
The manual describes the embedded Java interface, as you've probably seen. See also this section which briefly mentions the rather nice web-based management interface.