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.
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.
Official sources
- [1]jOOQ/jOOQ repository metadata(2026-10-04)
- [2]jOOQ 3.21.9 README(2026-10-04)
- [3]jOOQ 3.21.9 release(2026-10-04)
- [4]jOOQ 3.21.9 parent POM(2026-10-04)
- [5]jOOQ 3.21.9 license notice(2026-10-04)
- [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
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
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
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
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
Categories
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
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- DuckDB41,895 Stars
2 shared tag(s) · 1 shared category(s)
Run analytical SQL directly over CSV, Parquet, and DataFrames inside the application process without a database server
C++ - PostgreSQL22,271 Stars
2 shared tag(s) · 1 shared category(s)
combine SQL transactions, constraints, indexes, and extensible types/functions in an object-relational database engine
C - MySQL Server12,440 Stars
2 shared tag(s) · 1 shared category(s)
Run relational workloads with InnoDB transactions, SQL, replication, and high-availability tooling
C++ - MariaDB Server8,311 Stars
2 shared tag(s) · 1 shared category(s)
Provide MySQL-compatible protocols, pluggable storage engines, replication, and native vector search in one SQL database
C++ - Apache Spark44,116 Stars
2 shared tag(s)
Process SQL, DataFrames, streams, and machine learning on one distributed engine
Scala - Supabase111,062 Stars
1 shared tag(s) · 2 shared category(s)
Build on Postgres with integrated Auth, REST/GraphQL APIs, Realtime, Storage, and Functions
TypeScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.