database

Database connectivity and operations in Groovy.

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.” Last Updated: July 2026 | Tested on: Groovy 5.0.6, 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, close everything in a finally ... Read More

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

Groovy GINQ gives you SQL-like collection querying without leaving the language. 12+ examples covering select, where, joins, groupby, aggregates, and nested queries. Tested on Groovy 5.0.6. “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.” Last Updated: July 2026 | Tested on: Groovy 5.0.6, Java 17+ | Difficulty: Intermediate | Reading Time: 25 minutes What is GINQ in Groovy? If you’ve ever worked ... Read More