# Why You Should Execute jOOQ Queries With jOOQ

DevFeed: [Why You Should Execute jOOQ Queries With jOOQ](<https://devfeed.tech/articles/why-you-should-execute-jooq-queries-with-jooq-28974.md>)

Original publisher: [Read original article](<https://blog.jooq.org/why-you-should-execute-jooq-queries-with-jooq/>)

Author: lukaseder

Published: 2023-01-18T11:46:25Z

Content type: opinion

Language: en

Sources: [jOOQ](<https://devfeed.tech/sources/jooq.md>)

Topics: [SQL](<https://devfeed.tech/topics/sql.md>), [Java](<https://devfeed.tech/topics/java.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>)

Tags: [code-generation](<https://devfeed.tech/tags/code-generation.md>), [crud](<https://devfeed.tech/tags/crud.md>), [csv](<https://devfeed.tech/tags/csv.md>), [execution](<https://devfeed.tech/tags/execution.md>), [export](<https://devfeed.tech/tags/export.md>), [identity](<https://devfeed.tech/tags/identity.md>), [import](<https://devfeed.tech/tags/import.md>), [java](<https://devfeed.tech/tags/java.md>), [jdbc](<https://devfeed.tech/tags/jdbc.md>), [jooq](<https://devfeed.tech/tags/jooq.md>), [jooq-in-use](<https://devfeed.tech/tags/jooq-in-use.md>), [jpa](<https://devfeed.tech/tags/jpa.md>), [json](<https://devfeed.tech/tags/json.md>), [mapping](<https://devfeed.tech/tags/mapping.md>), [multiset](<https://devfeed.tech/tags/multiset.md>), [nested-collections](<https://devfeed.tech/tags/nested-collections.md>), [nested-records](<https://devfeed.tech/tags/nested-records.md>), [orm](<https://devfeed.tech/tags/orm.md>), [r2dbc](<https://devfeed.tech/tags/r2dbc.md>), [sql](<https://devfeed.tech/tags/sql.md>), [stored-procedures](<https://devfeed.tech/tags/stored-procedures.md>), [type-safety](<https://devfeed.tech/tags/type-safety.md>), [udt](<https://devfeed.tech/tags/udt.md>), [updatablerecord](<https://devfeed.tech/tags/updatablerecord.md>), [user-defined-types](<https://devfeed.tech/tags/user-defined-types.md>), [xml](<https://devfeed.tech/tags/xml.md>)

## AI overview

The article argues that queries built with jOOQ should generally also be executed with jOOQ. It explains that jOOQ preserves type safety and structured result mapping during execution, whereas extracting SQL and bind values for JDBC-level execution loses compiler knowledge of the result set. It acknowledges limited use cases for executing jOOQ-generated SQL elsewhere, such as a small number of dynamic queries in an otherwise JPA-based application.

## Source excerpt

Previously on this blog, I've written a post explaining why you should use jOOQ's code generator, despite the possibility of using jOOQ without it. In a similar fashion, as I've answered numerous jOOQ questions on Stack Overflow, where someone used jOOQ to build a query, but then executed it elsewhere, including on: jOOQ itself isn't ... Continue reading Why You Should Execute jOOQ Queries With jOOQ ->