• Post Reply Bookmark Topic Watch Topic
  • New Topic

jOOQ is the Best and an Increasingly Popular Way to Write SQL in Java  RSS feed

Lukas Eder
Ranch Hand
Posts: 49
Java Oracle Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is jOOQ becoming increasingly popular in the Java ecosystem?

Java and SQL are both very popular languages in enterprise software development. Yet, the only standard interface between the two is JDBC, which is agreed by many programmers to be a very awkward, stateful and verbose API. Being low-level, it covers (almost) complete access to all SQL standard and vendor-specific SQL functionality, but client code is tedious to write, string-based, and thus, error-prone.

Other alternative standards (JPA and JDO) mostly hide SQL from their clients. While they ease the pain for writing CRUD, querying may become very difficult or slow.

jOOQ is a true and increasingly popular Open Source alternative to the Java standards, where users want to embed typesafe SQL as an internal domain-specific language directly into their Java code. The Java compiler can infer a lot of SQL syntax, metamodel and data type typesafety for you via jOOQ's unique fluent API technique and row value expression typesafety.

These are typical SQL statements

... and this is how they translate to jOOQ


  • ... models a large subset of the SQL language in Java
  • ... translates functions and SQL clauses into equivalent SQL, if not supported by your database
  • ... executes your SQL and lets you transform flat result sets into your own domain model
  • ... ships with a code-generator which generates typesafe artefacts from your database meta data
  • ... allows for typesafely embedding your stored functions in SQL expressions

  • And much more. See more of jOOQ in the jOOQ tutorial. You will see that there is no better way to embed SQL into the Java language, than by using jOOQ
    It is sorta covered in the JavaRanch Style Guide.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!