<commit_before>== Overview: Neo4j JDBC Driver
:neo4j-jdbc-version: 3.0

image:https://travis-ci.org/neo4j-contrib/neo4j-jdbc.svg?branch=master["Build Status", link="https://travis-ci.org/neo4j-contrib/neo4j-jdbc"]

This is the official JDBC driver for Neo4j.

This driver was mainly developed by http://larus-ba.it[Larus BA, Italy], a certified consulting and integration solutions partner for Neo4j.
*Thank you* so much for all your work.

[NOTE]
The previous JDBC driver for Neo4j 2.x was moved to the https://github.com/neo4j-contrib/neo4j-jdbc-2x repository.

Being a graph database, Neo4j is not serving data in a relational way and the exact purpose of this project is to allow
projects that are using the classic JDBC connector in the relational paradigm to interact with Neo4j.

This driver supports various types of database transports:

* through the BOLT protocol (3.0.X) using `jdbc:neo4j:bolt://<host>:<port>/`
* through the HTTP protocol (2.X+) using `jdbc:neo4j:http://<host>:<port>/`

Going forward there will also be support for:

* direct file connection
* embedded connection

=== Maven dependency

[source,xml]
<dependency>
    <groupId>org.neo4j</groupId>
    <artifactId>neo4j-jdbc</artifactId>
    <version>3.0</version>
</dependency>

=== Minimum viable snippet

// tag::mvs[]
.Dependency declaration
[source,subs=attributes]
----
org.neo4j:neo4j-jdbc:{neo4j-jdbc-version}
----

.Run Query
[source,java]
----
// Connect
try (Connection con = DriverManager.getConnection("jdbc:neo4j:bolt://localhost")) {

    // Querying
    String query = "MATCH (u:User)-[:FRIEND]-(f:User) WHERE u.name = {1} RETURN f.name, f.age";
    try (PreparedStatement stmt = con.prepareStatement(query)) {
        stmt.setString(1,"John");

        try (ResultSet rs = stmt.execute()) {
            while (rs.next()) {
                System.out.println("Friend: "+rs.getString("f.name")+" is "+rs.getInt("f.age"));
            }
        }
    }
}
----
// end::mvs[]

=== Usage with Neo4j Server

* Install a Neo4j 3.0.X server and start it with the BOLT protocol enabled
* Connect with URLs in the form `jdbc:neo4j:bolt://<host>:<port>/` (e.g. `jdbc:neo4j:bolt://localhost/`)
* You can also use additional comma separated parameters in the URL for authentication, debug mode, ssl encryption and flattening e.g. `jdbc:neo4j:bolt://localhost/?user=neo4j,password=<PASSWORD>,debug=true,noSsl,flatten=[-1,100,1000]`

* Add the JDBC driver dependency or jar file to your project
* Get a connection from DriverManager
* Execute queries and transactions using the Cypher graph query language

=== Flattening

As most JDBC clients and tools don't support complex objects, the driver can flatten returned nodes and relationships by providing all their properties as individual columns with names like `u.name`,`r.since` if you just return a node `u` or relationship `r`.

This is enabled with the JDBC-URL parameter `flatten=rows`, where rows indicates how many rows are sampled to determine those columns.
With `-1` all rows are sampled and with any other value you determine the number of rows being looked at.

=== Building the driver yourself

First clone https://github.com/neo4j-contrib/neo4j-jdbc[the repository].

This project is composed by the following modules:

* https://github.com/neo4j-contrib/neo4j-jdbc/tree/master/neo4j-jdbc[Neo4j JDBC] - the core module
* https://github.com/neo4j-contrib/neo4j-jdbc/tree/master/neo4j-jdbc-bolt[Neo4j JDBC - Bolt] - module supporting the bolt protocol
* https://github.com/neo4j-contrib/neo4j-jdbc/tree/master/neo4j-jdbc-http[Neo4j JDBC - Http] - module supporting the http protocol
* https://github.com/neo4j-contrib/neo4j-jdbc/tree/master/neo4j-jdbc-driver[Neo4j JDBC - Driver packaging] - module to package all above modules


.Run all unitary tests & integration tests
-------------------------------------------------
mvn clean test
-------------------------------------------------

.Run only integration tests
-------------------------------------------------
mvn clean test -Pintegration-test
-------------------------------------------------

.Run performance tests
--------------------------------------------------
mvn clean test -Pperformance-test
--------------------------------------------------

[NOTE]
To run the performance test, you must have a Neo4j Server (3.0.X) running with the Bolt protocol enabled on port 7687 (default)

=== Release 3.0 Schedule

General Availability [RELEASED]

* Extensive Tests with a variety of tools
* Bug Fixes
* Documentation
* Better handling of credentials
* Support for additional API methods
* Explicit enabling of `flatten=<rows>` via jdbc URL

Release Candidate 1 [RELEASED]

* Move to github.com/neo4j-contrib
* Changed package to `org.neo4j`
* Released to Neo4j's maven repository
* HTTP protocol module

Milestone 03 [RELEASED]

* Batch processing
* Bug fix
* Neo4j Java Driver 1.0.1
* Neo4j 3.0.1


=== License

Copyright (c) 2016 http://neo4j.com[Neo4j] and http://www.larus-ba.it[LARUS Business Automation] 

The "Neo4j JDBC Driver" is licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and
limitations under the License.


=== Thank you

We'd like to thank:

The core development team:

* https://twitter.com/ziotobiad[<NAME>], Larus-BA - Software Developer
* http://twitter.com/mfalcier[<NAME>], Larus-BA - Software Developer
* http://twitter.com/glaggia[<NAME>], Larus-BA - Software Developer
* http://twitter.com/logisima[<NAME>], Neo4j - Technical Consultant at Neo Technology

Contributors:

* https://twitter.com/irregularbi[<NAME>], TiQ solutions - Qlik Luminary
* https://twitter.com/michaelvitz[<NAME>], InnoQ - Software Developer
* https://twitter.com/abusato95[<NAME>], Larus-BA - Software Developer
* https://github.com/enricomarin[<NAME>], Larus-BA - Software Developer

Supporters:

* http://twitter.com/inserpio[<NAME>], Larus-BA - Founder and CEO
* http://twitter.com/darthvader42[<NAME>], Neo4j - Customer Success Engineer for EMEA
* http://twitter.com/mesirii[<NAME>], Neo4j - Caretaker Neo4j Community
<commit_msg>Fix #72: document the correct dependency to use<commit_after>== Overview: Neo4j JDBC Driver
:neo4j-jdbc-version: 3.0

image:https://travis-ci.org/neo4j-contrib/neo4j-jdbc.svg?branch=master["Build Status", link="https://travis-ci.org/neo4j-contrib/neo4j-jdbc"]

This is the official JDBC driver for Neo4j.

This driver was mainly developed by http://larus-ba.it[Larus BA, Italy], a certified consulting and integration solutions partner for Neo4j.
*Thank you* so much for all your work.

[NOTE]
The previous JDBC driver for Neo4j 2.x was moved to the https://github.com/neo4j-contrib/neo4j-jdbc-2x repository.

Being a graph database, Neo4j is not serving data in a relational way and the exact purpose of this project is to allow
projects that are using the classic JDBC connector in the relational paradigm to interact with Neo4j.

This driver supports various types of database transports:

* through the Bolt protocol (3.0.X) using `jdbc:neo4j:bolt://<host>:<port>/`
* through the HTTP protocol (2.X+) using `jdbc:neo4j:http://<host>:<port>/`

Going forward there will also be support for:

* direct file connection
* embedded connection

=== Maven dependency

For the all-in-one module supporting both Bolt and HTTP, you can simply use:

[source,xml]
<dependency>
    <groupId>org.neo4j</groupId>
    <artifactId>neo4j-jdbc-driver</artifactId>
    <version>{neo4j-jdbc-version}</version>
</dependency>

If you only want one of the protocols, you can depend on its module:

[source,xml]
<dependency>
    <groupId>org.neo4j</groupId>
    <artifactId>neo4j-jdbc-bolt</artifactId>
    <version>{neo4j-jdbc-version}</version>
</dependency>

or

[source,xml]
<dependency>
    <groupId>org.neo4j</groupId>
    <artifactId>neo4j-jdbc-http</artifactId>
    <version>{neo4j-jdbc-version}</version>
</dependency>

=== Minimum viable snippet

// tag::mvs[]
.Dependency declaration
[source,subs=attributes]
----
org.neo4j:neo4j-jdbc-driver:{neo4j-jdbc-version}
----

.Run Query
[source,java]
----
// Connecting
try (Connection con = DriverManager.getConnection("jdbc:neo4j:bolt://localhost")) {

    // Querying
    String query = "MATCH (u:User)-[:FRIEND]-(f:User) WHERE u.name = {1} RETURN f.name, f.age";
    try (PreparedStatement stmt = con.prepareStatement(query)) {
        stmt.setString(1,"John");

        try (ResultSet rs = stmt.execute()) {
            while (rs.next()) {
                System.out.println("Friend: "+rs.getString("f.name")+" is "+rs.getInt("f.age"));
            }
        }
    }
}
----
// end::mvs[]

=== Usage with Neo4j Server

* Install a Neo4j 3.0.X server and start it with the Bolt protocol enabled
* Connect with URLs in the form `jdbc:neo4j:bolt://<host>:<port>/` (e.g. `jdbc:neo4j:bolt://localhost/`)
* You can also use additional comma separated parameters in the URL for authentication, debug mode, SSL encryption and flattening e.g. `jdbc:neo4j:bolt://localhost/?user=neo4j,password=<PASSWORD>,debug=true,noSsl,flatten=[-1,100,1000]`

* Add the JDBC driver dependency or jar file to your project
* Get a connection from `DriverManager`
* Execute queries and transactions using the Cypher graph query language

=== Flattening

As most JDBC clients and tools don't support complex objects, the driver can flatten returned nodes and relationships by providing all their properties as individual columns with names like `u.name`,`r.since` if you just return a node `u` or relationship `r`.

This is enabled with the JDBC-URL parameter `flatten=<rows>`, where `<rows>` indicates how many rows are sampled to determine those columns.
With `-1` all rows are sampled and with any other value you determine the number of rows being looked at.

=== Building the driver yourself

First clone https://github.com/neo4j-contrib/neo4j-jdbc[the repository].

This project is composed by the following modules:

* https://github.com/neo4j-contrib/neo4j-jdbc/tree/master/neo4j-jdbc[Neo4j JDBC] - the core module
* https://github.com/neo4j-contrib/neo4j-jdbc/tree/master/neo4j-jdbc-bolt[Neo4j JDBC - Bolt] - module supporting the Bolt protocol
* https://github.com/neo4j-contrib/neo4j-jdbc/tree/master/neo4j-jdbc-http[Neo4j JDBC - HTTP] - module supporting the HTTP protocol
* https://github.com/neo4j-contrib/neo4j-jdbc/tree/master/neo4j-jdbc-driver[Neo4j JDBC - Driver packaging] - module to package all above modules


.Run all unit tests & integration tests
-------------------------------------------------
mvn clean test
-------------------------------------------------

.Run only integration tests
-------------------------------------------------
mvn clean test -Pintegration-test
-------------------------------------------------

.Run performance tests
--------------------------------------------------
mvn clean test -Pperformance-test
--------------------------------------------------

[NOTE]
To run the performance test, you must have a Neo4j Server (3.0.X) running with the Bolt protocol enabled on port 7687 (default)

=== Release 3.0 Schedule

General Availability [RELEASED]

* Extensive Tests with a variety of tools
* Bug Fixes
* Documentation
* Better handling of credentials
* Support for additional API methods
* Explicit enabling of `flatten=<rows>` via JDBC URL

Release Candidate 1 [RELEASED]

* Move to github.com/neo4j-contrib
* Changed package to `org.neo4j`
* Released to Neo4j's maven repository
* HTTP protocol module

Milestone 03 [RELEASED]

* Batch processing
* Bug fix
* Neo4j Java Driver 1.0.1
* Neo4j 3.0.1


=== License

Copyright (c) 2016 http://neo4j.com[Neo4j] and http://www.larus-ba.it[LARUS Business Automation] 

The "Neo4j JDBC Driver" is licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and
limitations under the License.


=== Thank you

We'd like to thank:

The core development team:

* https://twitter.com/ziotobiad[<NAME>], Larus-BA - Software Developer
* https://twitter.com/mfalcier[<NAME>], Larus-BA - Software Developer
* https://twitter.com/glaggia[<NAME>], Larus-BA - Software Developer
* https://twitter.com/logisima[<NAME>], Neo4j - Technical Consultant at Neo Technology

Contributors:

* https://twitter.com/irregularbi[<NAME>], TiQ solutions - Qlik Luminary
* https://twitter.com/michaelvitz[<NAME>], InnoQ - Software Developer
* https://twitter.com/abusato95[<NAME>], Larus-BA - Software Developer
* https://github.com/enricomarin[<NAME>], Larus-BA - Software Developer

Supporters:

* https://twitter.com/inserpio[<NAME>], Larus-BA - Founder and CEO
* https://twitter.com/darthvader42[<NAME>], Neo4j - Customer Success Engineer for EMEA
* https://twitter.com/mesirii[<NAME>], Neo4j - Caretaker Neo4j Community

{'fraction_non_alphanumeric': 0.15445529899348728, 'fraction_numerical': 0.016651865008880995, 'mean_word_length': 3.4304918032786884, 'pattern_counts': {'":': 0, '<': 75, '<?xml version=': 0, '>': 75, 'https://': 33, 'lorem ipsum': 0, 'www.': 4, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6662394', 'n_tokens_mistral': 4288, 'n_tokens_neox': 4014, 'n_words': 1351}