query

Querying collections and databases with Groovy syntax.

Groovy SQL – Connect and Query Databases with 10+ Examples

Groovy SQL with 10+ examples. Connect to H2, MySQL, PostgreSQL using groovy.sql.Sql, run queries with eachRow, rows(), firstRow(). “The best tool for managing data is a well-written query.” C.J. Date, Database Relational Model Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Intermediate | Reading Time: 18 minutes If you have ever used JDBC in Java, you know how painful it can be. Open a connection, create a statement, execute a query, iterate through a ResultSet, ... Read More

Groovy GINQ – SQL-Like Collection Queries with 12 Tested Examples

Groovy GINQ for SQL-like collection querying. 12+ examples covering select, where, joins, groupby, aggregates, and nested queries. Tested on Groovy 5.x. “Why leave Groovy to write SQL when you can bring SQL into Groovy? GINQ lets you query collections like database tables – right in your code.” Paul Deitel, Java How to Program Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Intermediate | Reading Time: 25 minutes What is GINQ in Groovy? If you’ve ever ... Read More