Getting the data
A crucial part of report generation is data gathering. Data is arguably the most important input in a report. Having good "infrastructure code" for data gathering will highly improve maintainability in report modules. In this chapter, we'll use an SQL database, since it's probably the most common kind of data store in use. This means reports are filled with data queried using SQL. Reporting doesn't require saving data, only reading. SQL queries in reports tend to have multiple lines and are sometimes generated dynamically. MyBatis seems to be an excellent choice for reporting modules. MyBatis allows query definition in XML files, which, unlike Java Strings, help with long multi-line SQL queries and dynamic query definitions. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access