JDBC drivers
|
This is the public preview documentation of Neo4j Virtual Graph. To provide feedback, please use the feedback form you were granted access to. During the public preview, we advise you not to use sensitive or production data with Virtual Graph. |
JDBC is an industry standard for connecting Java programs to databases or, for that matter, also files, CRM systems and many more.
Supported drivers
In theory, you can load any JDBC driver added to Neo4j and attempt connecting to the remote system. In practice however, the supported SQL constructs on the other end can vary greatly. Hence we recommend you to use the supported JDBC drivers.
You can include any number of supported JDBC drivers, however some of them take up a lot of space, especially the Snowflake driver. In memory-restricted scenarios this can have a significant impact on the available heap space.
Here is the list of supported drivers:
Limiting the number of fetched rows
The driver-specific sections contain recommendations on how to limit the number of rows that are fetched at once.
While the JDBC standard defines a fetch size per result set, only the SQLite driver supports this standard.
For instance, if a user writes a query like MATCH (n:Movie) RETURN n without any limiting predicates, all rows of the underlying table must be fetched eventually.
However, the result set of the corresponding SELECT * FROM movies doesn’t necessarily have to be materialized in the server all at once.
In case a JDBC driver supports limiting the fetch size or has other means which reassemble rows or records, we recommend aligning the fetch size with the default one of all Neo4j client side drivers, which is 1000.
Installing JDBC drivers
JDBC drivers are usually shipped as one or more .jar files. Most of them are a single .jar file which you must place in the NEO4J\_HOME/lib folder. They are not loaded from plugins. When running Neo4j with Docker, you can mount individual drivers into the corresponding folder like this:
docker run --publish=7474:7474 --publish=7687:7687 \
-e 'NEO4J_AUTH=neo4j/verysecret' \
-e NEO4J_ACCEPT_LICENSE_AGREEMENT=yes \
-v $(pwd)/databricks-jdbc-3.4.1.jar:/var/lib/neo4j/lib/databricks-jdbc-3.4.1.jar \
neo4j:2025.10.1-enterprise
Docker does not support wildcard mounts into existing directories. If you try that, the existing lib folder is shadowed by the mounts and Neo4j can’t start. Therefore, you must enumerate the drivers. You can repeat the mount for every driver you want to include.
Logging
The connection pool HikariCP, uses SLF4J under the hood.
Several JDBC drivers, such as Snowflake’s, do too.
To get their logging into debug.log, Neo4j must be started with the following Java system property:
org.neo4j.server.Bootstrapper.useNeo4jSlf4jProvider=true
The packages from which logs are expected must be allow-listed through an internal internal.server.logs.filter.slf4j_class_prefixes configuration setting:
internal.server.logs.filter.slf4j_class_prefixes = org.eclipse.jetty, com.zaxxer.hikari
Log4j2-based logging should work out of the box. Virtual Graph doesn’t support logging of drivers that shade SLF4J or other logging facades.