JDBC Driver for Neo4j

Build 25.0.9434

Establishing a Connection

Creating a JDBC Data Source

You can create a JDBC data source to connect from your Java application. Creating a JDBC data source based on the CData JDBC Driver for Neo4j consists of three basic steps:

  1. Add the driver JAR file to the classpath. The JAR file is located in the lib subfolder of the installation directory. Note that the .lic file must be located in the same folder as the JAR file.
  2. Provide the driver class. For example:
    cdata.jdbc.neo4j.Neo4jDriver
  3. Provide the JDBC URL. For example:
    jdbc:neo4j:server=localhost;port=7474;user=neo4j;password=password;
    
    or
    
    jdbc:cdata:neo4j:server=localhost;port=7474;user=neo4j;password=password;

    You can use the second format above whenever there is a conflict in your application between drivers using the same URL format to ensure you are using the CData driver. The URL must start with either "jdbc:neo4j:" or "jdbc:cdata:neo4j:" and can include any of the connection properties in name-value pairs separated with semicolons.

Connecting to Neo4j

To connect to Neo4j, you have the following options:

If you are connecting to Neo4j AuraDB, you must use the Query API.

If you are connecting to Self-hosted Neo4j you can choose between the Query API and the HTTP API, depending on your version.

Connecting to Self-hosted Neo4j

Query API

To connect to Neo4j instances via the Query API, set the following connection properties:

  • API: Set this to Query.
  • Server: The server hosting the Neo4j instance. An HTTP or HTTPS protocol prefix may be optionally prepended to the server name or address.
  • Port: The port on which the Neo4j service is running. Self-managed instances have a default port of 7474 for the Query API. If connecting over HTTPS, supply the HTTPS port for the Neo4j instance specified in Server.
  • User: The username of the user using the Neo4j instance.
  • Password: The password of the user using the Neo4j instance.
  • Database: The database to target in the Neo4j instance. Defaults to Neo4j.

HTTP API

To connect to Neo4j instances via the HTTP API, set the following connection properties:

  • API: Set this to HTTP.
  • Server: The server hosting the Neo4j instance. An HTTP or HTTPS protocol prefix may be optionally prepended to the server name or address.
  • Port: The port on which the Neo4j service is running. The provider connects to HTTP 7474 port by default. If connecting over HTTPS, supply the HTTPS port for the Neo4j instance specified in Server.
  • User: The username of the user using the Neo4j instance.
  • Password: The password of the user using the Neo4j instance.
  • Database: The database to target in the Neo4j instance. Defaults to Neo4j.

Connecting to Neo4j AuraDB

Neo4j AuraDB

To connect to Neo4j Aura instances, the required properties will be the same as the Query API configuration above. Notes on finding property values are below.

  • API: Set this to Query.
  • Server: Found in Query API URL in the Inspect menu of the instance in the Neo4j Aura cloud console. Nothing after Neo4j.io should be provided.
  • Port: Set this to 443.
  • User: The username of the user using the Neo4j instance.
  • Password: Provided only once when creating the instance or when a new user is invited.
  • Database: Currently, Neo4j Aura deployments do not allow changing the database name from the default value of Neo4j.

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9434