1
1
# Neo4j Java Driver
2
2
3
- A database driver for a new Neo4j remoting protocol.
3
+ This is the first official Neo4j java driver for connecting to Neo4j-the-database via the newly designed remoting
4
+ protocol BOLT.
4
5
5
6
## Minimum viable snippet
6
7
@@ -10,27 +11,37 @@ Add the driver to your project:
10
11
<dependency>
11
12
<groupId>org.neo4j.driver</groupId>
12
13
<artifactId>neo4j-java-driver</artifactId>
13
- <version>1.0.0-RC1 </version>
14
+ <version>x.y.z </version>
14
15
</dependency>
15
16
</dependencies>
16
17
17
- Connect to a Neo4j 3.0.0+ database
18
+ * Please check the [ Releases] ( https://github.com/neo4j/neo4j-java-driver/releases ) for the newest driver version
19
+ available.
18
20
19
- Driver driver = GraphDatabase.driver( "bolt://localhost" );
21
+ Connect to a Neo4j 3.0.0+ database:
22
+
23
+ Driver driver = ( "bolt://localhost", AuthTokens.basic( "neo4j", "neo4j" ) );
20
24
21
25
Session session = driver.session();
22
26
23
- StatementResult rs = session.run("CREATE (n) RETURN n");
27
+ StatementResult rs = session.run( "CREATE (n) RETURN n" );
24
28
25
29
session.close();
26
30
27
31
driver.close();
28
32
29
- # Building
33
+ For more examples and details of usage, please refer to the [ Driver Manual] (http://neo4j.com/docs/developer-manual/3
34
+ .0/index.html#driver-manual-index).
35
+
36
+ ## Binding
37
+
38
+ The source code here reflects the current development status of a new driver version.
39
+ If you want to use the driver in your products, please use the released driver via maven central or check out the
40
+ code with git tags instead.
30
41
31
- ## Java version
42
+ ### Java version
32
43
33
- If you are running Java 8:
44
+ To compile the code and run all tests, if you are running Java 8:
34
45
35
46
mvn clean install
36
47
@@ -43,7 +54,27 @@ Java 8, because Neo4j-the-database needs it to run.
43
54
# For instance
44
55
export NEO4J_JAVA=$(/usr/libexec/java_home -v 1.8)
45
56
46
- ## Windows
57
+ ### Windows
58
+
59
+ If you are building on windows, you need to have Python (v2.7) installed and run install as admin,
60
+ so that Neo4j-the-database could be installed and started with Python scripts for integration tests.
61
+ Or you could choose to ignore integration tests by running:
62
+
63
+ mvn clean install -DskipITs
64
+
65
+ ## Q&A
66
+
67
+ ** Q** : Where can I find the changelogs?
68
+ ** A** : [ wiki] ( https://github.com/neo4j/neo4j-java-driver/wiki )
69
+
70
+
71
+ ** Q** : Why my driver stops working today after I upgrade my Neo4j server? It was working well yesterday.
72
+ ** A** : If the driver is configured to use [ trust-on-first-use]
73
+ (http://neo4j.com/docs/developer-manual/3.0/index.html#_trust ) mode,
74
+ then following the error message you got while using the driver, you might need to modify ` known_hosts ` file.
75
+
76
+
77
+ ** Q** : Why I cannot connect the driver to the server at ` bolt://localhost:7474 ` ?
78
+ ** A** : Bolt uses port 7687 by default, so try ` bolt://localhost:7687 ` or ` bolt://localhost ` instead.
47
79
48
- If you are building on windows, you need to run install as admin so that Neo4j-the-database could be registered as a
49
- windows service and then be started and stopped correctly using its powershell scripts for windows.
80
+ For any other questions, please refer to Github issues.
0 commit comments