Available in versions: Dev (3.18) | Latest (3.17) | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11 | 3.10 | 3.9 | 3.8

This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.

JDBC Connection

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

Sometimes, access to the JDBC java.sql.Connection is required from code that would otherwise use jOOQ. Your DSLContext and Configuration is configured with a JDBC Connection or DataSource via a org.jooq.ConnectionProvider, but rather than going through those SPIs, you can access (and acquire) a java.sql.Connection directly from your DSLContext. Just write:

// Alternatively, use DSLContext.connectionResult() to return a result from the lambda.
create.connection((Connection c) -> {

    // Modify your JDBC connection or get information from it
    c.setClientInfo("key", "value");
    // Operate on this modified JDBC connection


Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo