Building the Connection URL for Neo4j 4.x

Use the connection URL to supply connection information to the data store that you are accessing.

The following is the format of a basic connection URL for connecting to a Neo4j 4.x instance:

jdbc:neo4j://[Host]:[Port]/[Database]

In this example:

  • [Host] is the host name or IP address of the Neo4j server.
  • [Port] is the number of the TCP port that the Neo4j server uses to listen for client connections. The default Neo4j port is 7687.
  • [Database] is the optional name of the database to connect to on the Neo4j server. This parameter is optional. If it is not specified, the connector connects to the default database specified by the server.

You can also specify optional settings such as authentication, logging, or any of the other connection properties supported by the connector. Additional properties must be separated by either an ampersand (&) or a semicolon (;). For a list of the properties available in the connector, see Connector Configuration Options.

The following is the format of a connection URL that specifies some optional settings:

jdbc:neo4j://[Host]:[Port]/[OptionalDatabase]?[Property1]=[Value]&[Property2]=[Value]&...

For example, to connect to a Neo4j 4.x instance on port 7687 with the database mydata, on a Neo4j server installed on a machine named archimedes, using basic authentication, with the username skroob and password 12345, you would use the following connection URL:

jdbc:neo4j://archimedes:7687/mydata?&UID=skroob&PWD=12345

Important:

  • Property values are case-sensitive.
  • Do not duplicate properties in the connection URL.