Database Reference
In-Depth Information
To quickly setup a server instance with the sample data and plugins for this chapter, go to graphstory.com/
practicalneo4j . You will be provided with your own free trial instance, a knowledge base, and email support from
Graph Story. Alternatively, you may run a local Neo4j database instance with the sample data by going to
graphstory.com/practicalneo4j , downloading the zip file containing the sample database and plugins, and adding
them to your local instance.
Tip
Using the Sample Application
If you have already downloaded the sample application from graphstory.com/practicalneo4j for Java and
configured it within your local application environment, you can skip ahead to the next section.
Otherwise, you will need to go back to the “ Java and Neo4j Development Environment section and set up your
local environment in order to follow the examples in the sample application.
Struts2 Application Configuration
Before diving into the code examples, you need to update the configuration for the Struts2 application. In Eclipse
(or the IDE you are using), open the file GraphStoryConstants.java , which is located in the com.practicalneo4j.
graphstory.util package, and edit the GraphStory connection string information. If you are using a free account
from graphstory.com, you will change the username, password, and URL in Listing 12-14 with the one provided in
your graph console on graphstory.com .
Listing 12-14. Database Connection Settings for a Remote Service, such as Graph Story
public static final String DEFAULT_URL = " https:// username:password@theURL:7473";
If you have installed a local Neo4j server instance, you can modify the configuration to use the local address and
port that you specified during the installation, as in the example shown in Listing 12-15.
Listing 12-15. Database Connection Settings for Local Enviroment
public static final String DEFAULT_URL = "http://localhost:7474";
Once the environment is properly configured and started, you can open a browser to the URL, such as
http://practicalneo4j-java , and you should see a page like the one shown in Figure 12-6 .
 
 
Search WWH ::




Custom Search