Quarkus JDBC EDB
A Quarkus extension providing JDBC connectivity to EDB Postgres Advanced Server (EPAS), including GraalVM native image support.
Installation
Add the extension to your build file. With Maven, add the following dependency to your POM file:
<dependency>
<groupId>io.quarkiverse.edb</groupId>
<artifactId>quarkus-jdbc-edb</artifactId>
<version>1.2.0</version>
</dependency>
Supported versions
This extension requires Java 17 or later and Quarkus 3.33 or later.
Every commit is built and tested on JDK 17, 21 and 25, and an application is built against the oldest supported Quarkus version to verify it stays usable there.
Native image builds are verified on JDK 17 only. That is not a limitation of native image support: the native build uses a Mandrel builder image with its own bundled JDK, so it is insensitive to the JDK used to run the build. Note that Quarkus 3.39 raises the minimum GraalVM/Mandrel version to 25.0, which matters when building native images rather than when running them.
Configuration
quarkus.datasource.db-kind=edb
quarkus.datasource.username=enterprisedb
quarkus.datasource.password=secret
quarkus.datasource.jdbc.url=jdbc:edb://localhost:5444/edb
Two things differ from PostgreSQL and catch people out:
-
The default EPAS port is
5444, not PostgreSQL’s5432. -
The JDBC URL prefix must be
jdbc:edb:. The EDB driver rejectsjdbc:postgresql:.
Because this extension is usually the only JDBC driver on the classpath,
quarkus.datasource.db-kind may be omitted entirely and will resolve to edb.
This extension contributes no configuration properties of its own; it is configured entirely through the standard Quarkus datasource configuration.
Hibernate ORM
db-kind=edb maps to Hibernate ORM’s org.hibernate.dialect.PostgresPlusDialect, the dialect
written for EDB Postgres Advanced Server. No further configuration is required — in particular, do
not set quarkus.hibernate-orm.dialect manually.
TLS
Encrypted connections need no extra configuration beyond the driver’s own properties on the JDBC URL:
quarkus.datasource.jdbc.url=jdbc:edb://localhost:5444/edb?sslmode=verify-full&sslrootcert=/path/server.crt
sslmode=require encrypts the connection without validating the server certificate; verify-full
additionally verifies the certificate chain and the hostname. Mutual TLS is supported by adding a
client certificate and key:
...?sslmode=verify-full&sslrootcert=/path/ca.crt&sslcert=/path/client.crt&sslkey=/path/client.key.pk8
The client key must be in PKCS#8 DER format — the driver cannot read a PEM key:
openssl pkcs8 -topk8 -inform PEM -outform DER -in client.key -out client.key.pk8 -nocrypt
All of these work in native mode as well as JVM mode.
Flyway
Flyway works against EPAS, but needs two things that are easy to miss.
First, add the PostgreSQL database module. Since Flyway 10 each database lives in its own artifact,
and quarkus-flyway depends only on flyway-core. Migrations fail without this module regardless of
which database you use:
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-postgresql</artifactId>
</dependency>
Second, add changeServerName=true to the JDBC URL:
quarkus.datasource.jdbc.url=jdbc:edb://localhost:5444/edb?changeServerName=true
Flyway selects its database type from the product name reported through JDBC metadata and ships no
type for EnterpriseDB, which is what EPAS reports. Without this property migration fails with:
org.flywaydb.core.api.FlywayException: Unsupported Database: EnterpriseDB 18.4
Note that changeServerName=true changes what every reader of DatabaseMetaData sees, not just
Flyway. The Hibernate dialect is unaffected, because Quarkus resolves it at build time from the
db-kind, but application code branching on getDatabaseProductName() will see PostgreSQL.
Liquibase is affected in particular — see Liquibase.
Liquibase
Liquibase works against EPAS with no additional configuration. Unlike Flyway, it ships a database implementation for EnterpriseDB and selects it automatically, which you can see at startup:
EnterpriseDB jdbc:edb://... does not store DATE columns. Instead, it auto-converts them to TIMESTAMPs. (edb_redwood_date=true)
For that reason, do not set changeServerName=true when using Liquibase. It makes the driver report
PostgreSQL, so Liquibase selects its generic PostgreSQL implementation and loses the EDB-specific
handling shown above.
If an application uses both Flyway and Liquibase against the same datasource, these requirements
conflict: Flyway needs changeServerName=true, and Liquibase is better without it.
Native image
Native image compilation is supported and needs no additional configuration:
./mvnw install -Dnative
Limitations
-
No Dev Services.
quarkus.datasource.jdbc.urlmust be configured explicitly; Quarkus will not start a database container fordb-kind=edb. EPAS container images are distributed fromdocker.enterprisedb.comand require a subscription, so no default image can be assumed. Dev Services is planned for a future release. -
SQLXMLin native mode. Unlike the PostgreSQL extension, this extension does not substitute the driver’sSQLXMLimplementation to keep the JDK XML parsers out of the native image.SQLXMLworks correctly; the native image is simply larger when an application uses it.
Developing against community PostgreSQL
The EDB driver is a fork of pgjdbc and connects to a community PostgreSQL server, which is useful for local development and is how this extension’s own integration tests run in CI. Be aware of what is not present there:
-
Oracle compatibility mode — SPL, packages,
DBMS_*built-ins,ROWNUM,SYSDATE,DUAL, hierarchical queries. -
getDatabaseProductName()returnsPostgreSQLrather thanEnterpriseDB. -
The port is 5432 rather than 5444.
-
EPAS-only catalogs,
edb_configuration parameters, and redwood date semantics.
Note that the Hibernate dialect is selected at build time from the db-kind, so PostgresPlusDialect
is used in both cases.
Licensing
The com.enterprisedb:edb-jdbc driver is published on Maven Central under a dual licence:
BSD-2-Clause and the
EDB Limited Use Software License Agreement.
Review both before deploying.