{"id":13529222,"url":"https://github.com/neo4j/neo4j-jdbc","last_synced_at":"2026-01-18T05:41:59.169Z","repository":{"id":37514406,"uuid":"59779262","full_name":"neo4j/neo4j-jdbc","owner":"neo4j","description":"Official Neo4j JDBC Driver","archived":false,"fork":false,"pushed_at":"2026-01-14T08:52:23.000Z","size":9710,"stargazers_count":152,"open_issues_count":16,"forks_count":60,"subscribers_count":26,"default_branch":"main","last_synced_at":"2026-01-14T17:09:01.535Z","etag":null,"topics":["business-intelligence","driver","etl","integration","java","jdbc","neo4j","neo4j-driver","sql2cypher"],"latest_commit_sha":null,"homepage":"http://neo4j.github.io/neo4j-jdbc/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"larusba/neo4j-jdbc","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neo4j.png","metadata":{"files":{"readme":"README.adoc","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.adoc","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-05-26T19:56:00.000Z","updated_at":"2026-01-14T08:51:28.000Z","dependencies_parsed_at":"2023-12-14T16:27:38.412Z","dependency_job_id":"09ac9e5d-524a-4cae-8bc6-33089b18663a","html_url":"https://github.com/neo4j/neo4j-jdbc","commit_stats":{"total_commits":591,"total_committers":10,"mean_commits":59.1,"dds":0.4467005076142132,"last_synced_commit":"6d1c4609f7dda0bfc551a9c14de1a058aa0c1df4"},"previous_names":["neo4j/neo4j-jdbc","neo4j-contrib/neo4j-jdbc"],"tags_count":63,"template":false,"template_full_name":null,"purl":"pkg:github/neo4j/neo4j-jdbc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j%2Fneo4j-jdbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j%2Fneo4j-jdbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j%2Fneo4j-jdbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j%2Fneo4j-jdbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neo4j","download_url":"https://codeload.github.com/neo4j/neo4j-jdbc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j%2Fneo4j-jdbc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28531328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["business-intelligence","driver","etl","integration","java","jdbc","neo4j","neo4j-driver","sql2cypher"],"created_at":"2024-08-01T07:00:34.468Z","updated_at":"2026-01-18T05:41:59.117Z","avatar_url":"https://github.com/neo4j.png","language":"Java","funding_links":[],"categories":["REST API"],"sub_categories":["Java"],"readme":"= Neo4j JDBC Driver\nMichael Simons \u003cmichael.simons@neo4j.com\u003e\n:doctype: article\n:lang: en\n:listing-caption: Listing\n:source-highlighter: coderay\n:icons: font\n// tag::properties[]\n:groupId: org.neo4j\n:artifactIdCore: neo4j-jdbc\n:latest_version: 6.3.0\n:branch: main\n// end::properties[]\n:examplesdir: docs/src/main/asciidoc/modules/ROOT/examples\n\n[abstract]\n--\n// tag::abstract[]\nThis is the manual for the official Neo4j JDBC Driver.\n\nThis driver is officially supported and endorsed by Neo4j.\nIt is a standalone driver, independent of and *not* built on top of the https://github.com/neo4j/neo4j-java-driver[common Neo4j Java Driver].\nWhile the latter provides a Neo4j-idiomatic way to access Neo4j from Java, the JDBC driver adheres to https://docs.oracle.com/en/java/javase/17/docs/api/java.sql/java/sql/package-summary.html[JDBC 4.3].\n\nNOTE: This documentation refers to *this* driver as the _Neo4j JDBC Driver_ and to the idiomatic Neo4j driver as the _common Neo4j Java Driver_.\n// end::abstract[]\n--\n\nimage:https://github.com/neo4j/neo4j-jdbc/workflows/build/badge.svg[link=https://github.com/neo4j/neo4j-jdbc/actions]\nimage:https://sonar.neo4j.ninja/api/project_badges/measure?project=neo4j-jdbc\u0026token=sqb_6d14b417b6cd8c19820429dde7fd0dd34f0f5302\u0026metric=coverage[link=https://sonar.neo4j.ninja/dashboard?id=neo4j-jdbc]\nimage:https://sonar.neo4j.ninja/api/project_badges/measure?project=neo4j-jdbc\u0026token=sqb_6d14b417b6cd8c19820429dde7fd0dd34f0f5302\u0026metric=alert_status[link=https://sonar.neo4j.ninja/dashboard?id=neo4j-jdbc]\n\n== Download\n\n=== Include in a Maven build\n\n[source,xml,subs=\"verbatim,attributes\"]\n----\n\u003cdependency\u003e\n    \u003cgroupId\u003e{groupId}\u003c/groupId\u003e\n    \u003cartifactId\u003e{artifactIdCore}-full-bundle\u003c/artifactId\u003e\n    \u003cversion\u003e{latest_version}\u003c/version\u003e\n\u003c/dependency\u003e\n----\n\n=== Include in a Gradle build\n\n[source,groovy,subs=\"verbatim,attributes\"]\n----\ndependencies {\n    implementation '{groupId}:{artifactIdCore}-full-bundle:{latest_version}'\n}\n----\n\nAll https://github.com/neo4j/neo4j-jdbc/releases/[releases] from 6.0 onwards contain a zipped version of the driver, including a PDF version of the manual.\nWe offer several distributions, please have a look http://neo4j.github.io/neo4j-jdbc/{latest_version}/#_distribution[here] for more details.\nIf you feel adventurous, grab the code and build the driver yourself.\nYou find the instructions in our link:CONTRIBUTING.adoc[contribution documentation].\n\n== Quickstart\n\nAfter adding the bundle to your application, you can use the Neo4j JDBC driver as any other JDBC driver.\n\n// tag::quickstart[]\nTIP: In case any tooling asks you for the name of the concrete driver class, it is `org.neo4j.jdbc.Neo4jDriver`.\n\n[source, java, tabsize=4]\n.Acquire a connection and execute a query\n----\nimport java.sql.DriverManager;\nimport java.sql.SQLException;\nimport java.util.List;\n\npublic final class Quickstart {\n\n    static void queryWithCypher() {\n        var query = \"\"\"\n                MATCH (m:Movie)\u003c-[:ACTED_IN]-(p:Person)\n                RETURN m.title AS title, collect(p.name) AS actors\n                ORDER BY m.title\n                \"\"\";\n\n        var url = \"jdbc:neo4j://localhost:7687\";\n        var username = \"neo4j\";\n        var password = \"verysecret\";\n\n        try (var con = DriverManager.getConnection(url, username, password); // \u003c.\u003e\n                var stmt = con.createStatement();  // \u003c.\u003e\n                var result = stmt.executeQuery(query)) { // \u003c.\u003e\n\n            while (result.next()) { // \u003c.\u003e\n                var movie = result.getString(1); // \u003c.\u003e\n                var actors = (List\u003cString\u003e) result.getObject(\"actors\"); // \u003c.\u003e\n                System.out.printf(\"%s%n\", movie);\n                actors.forEach(actor -\u003e System.out.printf(\"\\t * %s%n\", actor));\n            }\n        }\n        catch (SQLException ex) {\n            throw new RuntimeException(ex);\n        }\n    }\n}\n----\n\u003c.\u003e Instantiate a JDBC connection. There's no need to do any class loading beforehand, the driver will be automatically registered\n\u003c.\u003e Create a (reusable) statement\n\u003c.\u003e Execute a query\n\u003c.\u003e Iterate over the results, as with any other JDBC result set\n\u003c.\u003e JDBC's indexing starts at 1\n\u003c.\u003e JDBC also allows retrieval of result columns by name; the Neo4j JDBC driver also supports complex objects, such as lists\n\nIn the example above we used Neo4j's _lingua franca_, https://neo4j.com/docs/getting-started/cypher-intro/[Cypher], to query the database.\nThe Neo4j JDBC Driver has limited support for using SQL as well.\nIt can do so automatically or on a case-by-case basis.\nTo translate a single, call `java.sql.Connection#nativeSQL(String)` and use the result in your queries.\nFor automatic translation, instantiate the driver setting the optional URL parameter `sql2cypher` to `true`.\nThe following example shows how:\n\n[source, java, tabsize=4, indent=0]\n.Configure the JDBC driver to automatically translate SQL to cypher.\n----\nvar query = \"\"\"\n        SELECT m.title AS title, collect(p.name) AS actors\n        FROM Person as p\n        JOIN Movie as m ON (m.id = p.ACTED_IN)\n        ORDER BY m.title\n        \"\"\"; // \u003c.\u003e\n\nvar url = \"jdbc:neo4j://localhost:7687?enableSQLTranslation=true\";\n\ntry (var con = DriverManager.getConnection(url, username, password);\n        var stmt = con.createStatement();\n        var result = stmt.executeQuery(query)) {\n\n    while (result.next()) {\n        var movie = result.getString(1);\n        var actors = (List\u003cString\u003e) result.getObject(\"actors\");\n        System.out.printf(\"%s%n\", movie);\n        actors.forEach(actor -\u003e System.out.printf(\"\\t * %s%n\", actor));\n    }\n}\n----\n\u003c.\u003e This SQL query will be translated into the same Cypher query of the previous example.\nThe remainder of the method is identical to before.\n\n// end::quickstart[]\n\nFor more information, see http://neo4j.github.io/neo4j-jdbc/main/#s2c_introduction[SQL to Cypher translation].\n\n== Introduction\n// tag::introduction[]\nJDBC stands for \"Java Database Connectivity\" and is thus not bound exclusively to relational databases.\nNevertheless, JDBC's terms, definitions, and behavior are highly influenced by SQL and relational databases.\nAs Neo4j is a graph database with quite a different paradigm than relational and a non-standardized behaviour in some areas, there might be some details that don't map 100% in each place, and we make sure to educate you about these in this documentation.\n\nThis documentation focuses on install, use, and configure the Neo4j JDBC Driver, as well as discussing the driver's design choices.\nWhile we do provide runnable examples showing how to use JDBC with Neo4j, this is not a documentation about how to correctly use JDBC as an API.\n\nNOTE: The Neo4j JDBC Driver requires JDK 17 on the client side and Neo4j 5.5+ on the server side.\nTo use it with a Neo4j cluster, server-side routing must be enabled on the cluster.\n\n=== Features\n\n* Fully supports the Java module system\n* Adheres to JDBC 4.3\n* Can run any Cypher statement\n* Implements `DatabaseMetaData` and `ResultSetMetaData` as fully as possible with a nearly schemaless database and general very flexible result sets, allowing for automatic metadata retrieval from ETL and ELT tools\n* Provides an https://en.wikipedia.org/wiki/Service_provider_interface[SPI] to hook in translators from SQL to Cypher\n* Provides an optional default implementation to translate many SQL statements into semantically similar Cypher statements\n* Can be safely used with JDBC connection pools as opposed to the common Neo4j Java Driver or any JDBC driver based on that, as it doesn't do internal connection pooling and transaction management otherwise than dictated by the JDBC Spec\n\nThe absence of any connection pooling and transaction management is an advantage of the Neo4j JDBC Driver over the common Neo4j Java Driver.\nIt allows to pick and choose any database connection pooling system such as https://github.com/brettwooldridge/HikariCP[HikariCP] and transaction management such as https://jakarta.ee/specifications/transactions/[Jakarta Transactions].\n\n=== Limitations\n\n* The database metadata is retrieved using Neo4j's schema methods, such as `db.labels`, `db.schema.nodeTypeProperties()`, which may not always be accurate\n* While single label nodes map naturally to table names, nodes with multiple labels don't\n* There is no reliable way to always determine the datatype for properties on nodes, as it would require reading all of them (which this driver does not do)\n* Some JDBC features are not supported yet (such as the `CallableStatement`); some feature will never be supported\n* The SQL to Cypher translator supports only a limited subset of clauses and SQL constructs that can be equivalently translated to Cypher (See xref:sql2cypher.adoc#s2c_supported_statements[Supported statements])\n* There is no \"right\" way to map `JOIN` statements to relationships, so your mileage may vary\n\n=== When to use the Neo4j JDBC Driver?\n\n* Integration with ETL and ELT tools that don't offer an integration based on the common Neo4j Java driver\n* An easier on-ramp towards Neo4j for people familiar with JDBC, who want to keep using that API, but with Cypher and Neo4j\n* Integration for ecosystems like Jakarta EE whose transaction management directly supports any JDBC-compliant driver\n* Integration with database migration tools such as Flyway\n\n*There is no need to redesign an application that is built on the common Neo4j Java Driver to migrate to this driver.*\nIf your ecosystem already provides a higher-level integration based on the common Neo4j Java Driver, such as https://github.com/spring-projects/spring-data-neo4j[Spring Data Neo4j (SDN)] for https://spring.io/projects/spring-boot/[Spring], there is no need to switch to something else.\nIn case of https://quarkus.io[Quarkus], the Neo4j JDBC Driver is an option to consider: although we do provide an integration for the https://github.com/quarkiverse/quarkus-neo4j[common Neo4j Java Driver], this integration does not support Quarkus' transaction systems in contrast to this driver.\n\nAs there is little incentive to use this driver with Hibernate (https://github.com/neo4j/neo4j-ogm[Neo4j-OGM] or SDN are the best alternatives for Neo4j), it might be worth giving https://spring.io/projects/spring-data-jdbc/[Spring Data JDBC] a try.\n\n=== Differences with the previous versions of this driver and other JDBC drivers for Neo4j\n\nSeveral other JDBC drivers exists for Neo4j, most notably the previous versions 4 and 5 of this driver.\nMost (if not all) of them wrap the common Neo4j Java Driver and implement the JDBC spec on top of that.\nThis comes with a number of issues:\n\n* You end up with a _pool of connection pools_, because the common Neo4j Java Driver manages a connection pool, whereas JDBC drivers delegate this task to dedicated pooling solutions.\n* The transaction management of the common Neo4j Java Driver is not aligned with the way JDBC manages transactions.\n* Older versions of the Neo4j JDBC driver shade a few dependencies, such as `Jackson` as well as additional logging frameworks.\nThis takes a toll on the classpath and, in case of logging, it leads to runtime problems.\n* Existing drivers with an SQL-to-Cypher translation layer are \"read-only\" and don't support write statements, so they cannot be used for ETL use-cases aiming to ingest data into Neo4j.\n\nWARNING: This driver does not support automatic reshaping or flattening of the result sets, as the previous versions do.\nIf you query for nodes, relationships, paths, or maps, you should use `getObject` on the result sets and cast them to the appropriate type (you find all of them inside the package `org.neo4j.jdbc.values`).\nHowever, the default SQL-to-Cypher translator will (when connected to a database) figure out what properties nodes have and turn the asterisk (`*`) into individual columns of nodes and relationships, just like what you would expect when running a `SELECT *` statement.\n\n// end::introduction[]\n\nFor information on upgrade/migration from other drivers to this one, see http://neo4j.github.io/neo4j-jdbc/main/#_migrating_from_older_versions_or_other_jdbc_drivers_for_neo4j[Migrating from older versions or other JDBC drivers for Neo4j].\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneo4j%2Fneo4j-jdbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneo4j%2Fneo4j-jdbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneo4j%2Fneo4j-jdbc/lists"}