Database Reference
In-Depth Information
Chapter 12
Neo4j + Java
This chapter focuses on using Java with Neo4j and reviewing the code for a working application that integrates the five
graph model types covered in Chapter 4. The Java integration takes place using a Neo4j server instance with the Neo4j
JDBC driver, henceforth referred to as Neo4j JDBC or simply NJDBC . This chapter is divided into the following topics:
Java & Neo4j Development Environment
Common operations using Java and Neo4j JDBC
Developing a Java and Neo4j web application
In each chapter that explores a particular language paired with Neo4j, I recommend that you start a free trial at
www.graphstory.com or have installed a local Neo4j server instance as shown in Chapter 2.
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.
Tip
For this chapter, I expect that you have at least a beginning knowledge of Java web application development and
a basic understanding of how to configure the Apache Tomcat servlet container for your preferred operating system.
You should be able to run the web application in other servlet containers, as well. To follow the examples in this
chapter, you will need to have Tomcat 7 or higher installed and configured.
If you do not have Apache Tomcat installed, please visit http://tomcat.apache.org/ and download
Tomcat version 7. The configuration steps of Tomcat are beyond the scope of this topic, but the wiki section on the Apache
Tomcat site provides a detailed guide to guide you through more detailed configuration and optimization techniques.
Do This
I also expect that you have a basic understanding of the model-view-controller (MVC) pattern as well as some
knowledge of Java web frameworks that provide an MVC pattern. There are, of course, a number of excellent Java
frameworks from which to choose, but I had to pick one. For the purposes of the application in this chapter, I chose
the Struts2 framework because of its stability, which helps keep the focus on the important aspects of this application
as it relates to NJDBC and Neo4j. This chapter is focused on integrating Neo4j into your Java skill set and projects and
does not dive deeply into the best practices of developing with Java or Java web frameworks.
 
 
Search WWH ::




Custom Search