Fetching via JDBC ResultSet
jOOQ is an extremely versatile and transparent tool. For instance, jOOQ acts as a wrapper for JDBC ResultSet but also allows us to access it directly and even provide support to do this smoothly and painlessly. Practically, we can do the following:
- Execute a
ResultQuerywith jOOQ, but return a JDBCResultSet(this relies on thefetchResultSet()method). - Transform the jOOQ
Resultobject into a JDBCResultSet(this relies on theintoResultSet()method). - Fetch data from a legacy
ResultSetusing jOOQ.
All three of these bullets are exemplified in the bundled code. However, here, let's consider the second bullet that starts with the following jOOQ query:
// Result<Record2<String, BigDecimal>> var result = ctx.select(CUSTOMER.CUSTOMER_NAME, CUSTOMER.CREDIT_LIMIT).from(CUSTOMER).fetch();
We understand that the returned result is a jOOQ-specific Result that was built automatically from the...