Chapter 5. Working with Data

The last few chapters have focused on the BIRT working environment and the visual elements used to develop reports, without the data element. This chapter will bridge that gap and focus on the data-specific elements of the BIRT environment, build some example reports using data from the example Classic Models Inc. database, and work with a separate MySQL database.

BIRT data capabilities

As BIRT is a Java-centric reporting environment built on top of Eclipse, many different data tools provide BIRT with its data capabilities. Building on the Eclipse ODA data platform, BIRT can provide data from a wide array of different sources. JDBC can be used to provide connections to many of the popular Relational Database Management Systems out in the market such as Oracle, MySQL, Microsoft SQL Server, and PostgreSQL. Using plain old Java objects, web services, and persistent data objects are just some of the sources that BIRT can connect to.

In addition to the classic client-or server-based reporting capabilities afforded to BIRT through this mechanism, BIRT also offers some extensible data handling capabilities through a number of different mechanisms. The Eclipse Data Tools Project is being leveraged by BIRT for its XML Data Source handling. The Eclipse Open Data Access Framework (a.k.a. ODA framework) allows developers to build custom drivers for data connections that JDBC doesn't actually provide connectors for. The Classic Cars sample database was built using ODA. For the Java-centric developers who are looking for more flexibility or have specific needs in mind, BIRT's extensible event handling model allows Java programmers to write scripted Data Sources where the data is populated either through Java code or JavaScript code at runtime.

Most of these are topics that are beyond the scope of this book. In this chapter, we are going to focus primarily on using the Classic Cars example database and configuring BIRT to use a JDBC database connection to MySQL. This will give the reader some familiarity with the basics of how to establish a connection to a database using JDBC drivers. Some familiarity with SQL is assumed; however, the queries used in the exercises and examples will be provided for those who are not familiar with SQL.

In Chapter 3, The BIRT Environment and First Report, we looked at a simple employee listing report using the Classic Cars database. To avoid duplicating exercises, we will leverage that report in the following discussions in order to demonstrate the remaining data centric components of BIRT, and to illustrate how to get data from data containers into reports.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset