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. Use the multimodel extension for MongoQL and for accessing document collection metadata.
Requirements
These guides use JDBC driver 3.1 with Polypheny’s Prism 2.2 interface. The driver runs on Java 8 or later. See the JDBC reference for supported operations and feature limits.
Installation
Add the dependency to the <dependencies> section of your Maven project’s pom.xml:
<dependency>
<groupId>org.polypheny</groupId>
<artifactId>polypheny-jdbc-driver</artifactId>
<version>3.1</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:3.1'
}
To install the driver manually, put polypheny-jdbc-driver-3.1.jar on your application’s classpath. The released JAR bundles the driver’s runtime dependencies. Download the release JAR or find the same artifact on Maven Central and GitHub Packages.
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 3.1 release implements 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.
- See the integration guides for Java, Groovy, Kotlin, Scala, and DataGrip.
The driver is open source. Browse the v3.1 source.
Acknowledgments
Tobias Hafner developed the initial JDBC driver as part of his bachelor’s thesis at the University of Basel. Tobias Hafner on GitHub