The Polypheny JDBC Driver is a Type 4 driver for Java and other JVM languages. It connects directly to Polypheny’s Prism query interface. Use standard JDBC interfaces for SQL queries and transactions. The multimodel extension supports MongoQL, Cypher, and document collection metadata over the same connection.
Requirements
The driver runs on Java 8 or later. The Cypher graph examples use driver 3.2 and a server build with Cypher over Prism.
Installation
Choose a driver version that supports the Prism features you need from Maven Central. Replace VERSION with that version in the examples below. For Maven, add the dependency to the <dependencies> section of your pom.xml.
<dependency>
<groupId>org.polypheny</groupId>
<artifactId>polypheny-jdbc-driver</artifactId>
<version>VERSION</version>
</dependency>
For a Gradle project using the Java plugin, add Maven Central and the driver to build.gradle.
repositories {
mavenCentral()
}
dependencies {
implementation 'org.polypheny:polypheny-jdbc-driver:VERSION'
}
To install manually, download the bundled JAR from GitHub Releases and put it on your application’s classpath.
Connecting
Start Polypheny with the Prism interface enabled. Its default TCP port is 20590. A local JDBC URL is jdbc:polypheny://localhost:20590/. Append a namespace such as public to the path to select it, or omit the namespace to use the server’s default. Supply the username and password separately through DriverManager.getConnection(url, user, password) or a Properties object. The driver registers automatically through Java’s service loader.
The driver uses the plain Prism transport. See the driver reference for URL syntax, connection properties, and troubleshooting.
Examples and reference
- Runnable JDBC examples cover prepared SQL, batch execution, transactions, and MongoQL.
- The relational reference covers connections, statements, prepared statements, result sets, and database metadata.
- The multimodel reference covers the Polypheny-specific connection, statement, and result types, as well as collection metadata.
- The Cypher and graph results guide demonstrates graph results and relational projections with graph-valued columns.
- See the integration guides for Java, Groovy, Kotlin, Scala, and DataGrip.
The driver is open source. Browse the source repository.
Acknowledgments
Tobias Hafner developed the initial JDBC driver as part of his bachelor’s thesis at the University of Basel. Tobias Hafner on GitHub