Chapter 13. Database programming with Groovy

 

This chapter covers

  • Using the low-level Groovy API for interacting with relational databases
  • Transactions, batching operations, and retrieving database metadata
  • DataSets for performing CRUD operations
  • Architectural and design of a data access layer
  • Groovy and NoSQL databases

As far as the laws of mathematics refer to reality, they are not certain, and as far as they are certain, they do not refer to reality.

Albert Einstein

Databases are stores of structured data. If your Groovy application needs persistent data, you most likely will need to talk to one. There are many different kinds, each with particular advantages, disadvantages, and characteristics; luckily Groovy makes it easy to talk to whichever kind you need. Perhaps the most well-known kind of database is the family of relational[1] databases, but other kinds include object-oriented, key–value stores, document-centric, and graph. We’ll concentrate on relational databases first and briefly cover some of the NoSQL[2] forms later in the chapter.

1 An Introduction to Database Systems, by C. J. Date (Addison-Wesley, 2003).

2 Seven Databases in Seven Weeks: A Guide to Modern Databases and the NoSQL Movement, by E. Redmond and J. R. Wilson (Pragmatic Programmers, 2012).

13.1. Groovy SQL: a better JDBC

13.2. Advanced Groovy SQL

13.3. DataSets for SQL without SQL

13.4. Organizing database work

13.5. Groovy and NoSQL

13.6. Other approaches

13.7. Summary

sitemap