OSS TanbouSign in with GitHub

Build SQL through a type-safe Java DSL and generate code from database schemas

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
6,793
Primary language
Java
License
Not determined
Repository last updated
Oct 1, 2026
On this page

Overview

jOOQ is a Java library that models SQL as an internal DSL and generates typed table and column code from a database schema. It preserves SQL's expressiveness while making identifier mistakes and type mismatches easier to catch through compilation and IDE completion. Alongside JDBC execution, its APIs cover dynamic SQL, DAOs, R2DBC, import and export, and SQL parsing and translation.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Construct SQL with generated table and column types

The code generator turns schema metadata into Java representations of tables and columns, and the DSL models SQL structures such as SELECT, JOIN, predicates, and ordering. Changes to a column name, type, or target DTO can surface as compilation failures, keeping SQL and application code connected during maintenance.

Sources: [2]

Handle complex SQL, nested results, multiple dialects, JDBC, and R2DBC

The README demonstrates nested collections with MULTISET, implicit joins, and conversion into DTOs. The project also covers dynamic SQL, DDL and DML, parsing and translation, transactions, JDBC execution, reactive fetching through R2DBC, and many RDBMS dialects.

Sources: [2]

Best fit

Fits Java teams that want explicit SQL with schema-aware type checking

jOOQ suits applications with complex queries, database-specific features, or reporting work where hiding SQL is undesirable but unstructured SQL strings are also costly. Teams can place code generation in CI or the build to detect schema and application mismatches earlier.

Sources: [2][6]

Before adoption

Check Java, code-generation workflow, database coverage, and edition licensing first

The 3.21.9 parent POM targets Java 21. Receiving the full type-safety benefit requires a repeatable schema code-generation workflow and a policy for refreshing generated sources. GitHub reports NOASSERTION, while the repository LICENSE describes Apache-2.0 and commercial licenses; the official setup guide says only the Open Source Edition is available from Maven Central. Confirm the edition for the target database, Java baseline, and support needs. Release 3.21.9 is a patch release with many fixes, including R2DBC cancellation and transaction issues.

Sources: [4][5][6][3]

Official sources

  1. [1]jOOQ/jOOQ repository metadata(2026-10-04)
  2. [2]jOOQ 3.21.9 README(2026-10-04)
  3. [3]jOOQ 3.21.9 release(2026-10-04)
  4. [4]jOOQ 3.21.9 parent POM(2026-10-04)
  5. [5]jOOQ 3.21.9 license notice(2026-10-04)
  6. [6]jOOQ 3.21 manual — preparation(2026-10-04)
Supplemental curator note

jOOQ is not primarily an ORM that hides SQL; it keeps SQL central while adding Java types and IDE assistance. Before adopting it, check whether the target database is covered by the Open Source Edition and how code generation will fit the build.

Try it in 3 steps

  1. 1

    Create a Java 21 evaluation project

    Use Maven Compiler Plugin 3.15.0 and Java 21 as in the fixed release POM, with the Open Source Edition 3.21.9 from Maven Central.

    mkdir jooq-demo && cd jooq-demo && printf '%s\n' '<project xmlns="http://maven.apache.org/POM/4.0.0"><modelVersion>4.0.0</modelVersion><groupId>demo</groupId><artifactId>jooq-demo</artifactId><version>1</version><properties><maven.compiler.release>21</maven.compiler.release></properties><dependencies><dependency><groupId>org.jooq</groupId><artifactId>jooq</artifactId><version>3.21.9</version></dependency></dependencies><build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.15.0</version><configuration><release>21</release></configuration></plugin></plugins></build></project>' > pom.xml
  2. 2

    Add a minimal typed-DSL program

    Construct a PostgreSQL SELECT statement through the Java DSL without connecting to a database.

    mkdir -p src/main/java && printf '%s\n' 'import static org.jooq.impl.DSL.*;' 'import org.jooq.SQLDialect;' 'class Main { public static void main(String[] a) { System.out.println(using(SQLDialect.POSTGRES).select(inline(1).as("answer")).getSQL()); } }' > src/main/java/Main.java
  3. 3

    Inspect the generated SQL

    Confirm that the program prints SQL equivalent to select 1 as "answer".

    mvn -q compile org.codehaus.mojo:exec-maven-plugin:3.6.2:java -Dexec.mainClass=Main
Check the official README

Growth

Growth trends · Last 30 days

6,793 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
31
Open PRs
2

Development activity is still being collected.

Built with

Categories and tags

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • jooq
  • java
  • sql
  • jpa
  • sql-builder
  • sql-query
  • sql-query-builder
  • sql-query-formatter
  • sql-formatter
  • database
  • code-generator
  • jdbc
Stars
6,793
Forks
1,218
Watchers
149
Open issues
2,115
Contributors
86
Owner type
Organization
Primary language
Java
License
Not determined
Repository last updated
Oct 1, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?