Groovy

Groovy programming language tutorials, examples, and best practices.

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 Grape – Dependency Management for Scripts | 12 Tested Examples

Groovy Grape dependency management with @Grab. 12+ examples covering @GrabConfig, @GrabExclude, @GrabResolver, custom repos, and Grape cache. Groovy 5.0.6. “The best scripts are the ones that just work – no build files, no setup, no excuses. Groovy Grape makes that possible.” Last Updated: July 2026 | Tested on: Groovy 5.0.6, Java 17+ | Difficulty: Beginner to Intermediate | Reading Time: 25 minutes What is Groovy Grape? Ever wanted to use Apache Commons, Google Guava, or a JDBC driver in a ... Read More

Groovy CSV Parsing and Generation – 10+ Tested Examples

Groovy CSV parsing and generation with 10+ examples. Split, tokenize, OpenCSV, read/write CSV files, handle headers and special chars on Groovy 5.0.6. “CSV files are the cockroaches of data formats – they survive everything and show up everywhere. Groovy gives you clean ways to deal with them.” Last Updated: July 2026 | Tested on: Groovy 5.0.6, Java 17+ | Difficulty: Beginner to Intermediate | Reading Time: 22 minutes CSV files are everywhere – data exports, spreadsheet dumps, log files, database ... Read More