Available in versions: Dev (3.18) | Latest (3.17) | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11 | 3.10 | 3.9 | 3.8

This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.


Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

In a more functional operating mode, you might want to write callbacks that receive records from your select statement results in order to do some processing. This is a common data access pattern in Spring's JdbcTemplate, and it is also available in jOOQ. With jOOQ, you can implement your own org.jooq.RecordHandler classes and plug them into jOOQ's org.jooq.ResultQuery:

// Write callbacks to receive records from select statements
      .into(new RecordHandler<BookRecord>() {
          public void next(BookRecord book) {
// Or more concisely
      .fetchInto(new RecordHandler<BookRecord>() {...});
// Or even more concisely with Java 8's lambda expressions:
      .fetchInto(book -> { Util.doThingsWithBook(book); }; );

See also the manual's section about the RecordMapper, which provides similar features


Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo