Custom 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. |
Virtual Graph enables customers to bring their own driver to connect to any SQL-compliant data source using JDBC with the vendor’s driver:
-
ClickHouse
-
MySQL, Oracle
-
PostgreSQL
-
Oracle Database
The driver is loaded and then used to query the remote database with a generic SQL dialect.
The dialect reported to the engine is always Default.
The generic type provides best-effort support for different data sources: the SQL dialect, type handling, and driver configuration details are entirely the user’s responsibility. Neo4j support is happy to help you set up your own driver.
How the driver is loaded
Drop the driver .jar file to NEO4J_HOME/lib exactly like the curated drivers below.
Virtual Graph does not load JDBC drivers by class name.
The driver is resolved from the JDBC URL’s subprotocol by java.sql.DriverManager through the standard service loader, so it must be a driver that registers itself with DriverManager.
Configuration
The data source definition requires a JDBC URL of the form jdbc:<subprotocol>:… and an optional additionalProperties object.
Every entry in additionalProperties except for some reserved keys like hikari.minimumIdle, hikari.maximumPoolSize and jdbc.fetch_size is forwarded verbatim to the underlying driver via HikariConfig#setDataSourceProperties.
Example for Oracle Database:
{
"type": "generic",
"url": "jdbc:oracle:thin:@//salesserver1:1521/sales.us.example.com",
"additionalProperties": {
"defaultRowPrefetch": "42",
"encryption_client": "accepted"
}
}
Example for PostgreSQL:
{
"type": "generic",
"url": "jdbc:postgresql://db.example.com:5432/sales",
"additionalProperties": {
"ApplicationName": "graph-engine"
}
}
The URLs can contain URL query parameters that the underlying driver might need or supports.
Oracle Drivers are available on the Oracle website, PostgreSQL JDBC Drivers are available on the PostGreSQL JDBC Driver website.
If any generic driver requires more than one single .jar file, place them all into the lib folder of Neo4j. This is the case for Oracle. Get the "Zipped JDBC driver (ojdbc17.jar) and Companion Jars". Note that it is wrongly labeled on the download page as "11".