Groovy Database

Groovy database programming with groovy.sql.Sql. CRUD operations, transactions, batch processing, stored procedures, connection pooling, and DataSet.

Groovy DataSet – 12 Tested Examples for Type-Safe Database Queries

Groovy DataSet for type-safe database queries. 12 examples covering findAll, sort, add, chaining, generated SQL.x with H2. “The best database code is the code that doesn’t look like SQL at all. Groovy’s DataSet lets you query databases with closures instead of strings.” Martin Fowler, Patterns of Enterprise Architecture Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Intermediate | Reading Time: 25 minutes What Is Groovy DataSet? If you have been writing raw SQL strings with ... Read More

Groovy SQL Batch Processing – withBatch Performance Guide with 12 Examples

Groovy SQL batch processing with withBatch for high-performance bulk inserts. 12+ examples covering batch size tuning, performance benchmarks, large dataset handling, and combining batches with transactions. “A database without transactions is like a bank without locks – everything works fine until two people reach for the same cash at the same time.” Jim Gray, Transaction Processing Pioneer Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Intermediate to Advanced | Reading Time: 25 minutes Inserting one ... Read More

Groovy SQL Stored Procedures and Functions with 10+ Examples

how to use Groovy stored procedure calls and functions from Groovy with 10+ examples. Cover input/output parameters, result sets, and database-specific syntax. “Push logic down to the database when performance demands it.” — Unknown Joe Celko, SQL for Smarties Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Intermediate to Advanced | Reading Time: 17 minutes Calling a groovy stored procedure through the groovy.sql.Sql class is simple – you get call(), eachRow(), and direct CallableStatement access ... Read More