A recent question on Stack Overflow about jOOQ caught my attention. The question essentially asked: Why do both of these loops work? // With fetch() for (MyTableRecord rec : DSL .using(configuration) .selectFrom(MY_TABLE) .orderBy(MY_TABLE.COLUMN) .fetch()) { // fetch() here doThingsWithRecord(rec); } // Without fetch() for (MyTableRecord rec : DSL .using(configuration) .selectFrom(MY_TABLE) .orderBy(MY_TABLE.COLUMN)) { // No fetch() … Continue reading A Hidden jOOQ Gem: Foreach Loop Over ResultQuery