## Hierarchical data source API

As a database application, JReport Designer cannot only access data stored in a database through the JDBC connection and user data source (UDS), but also supports the importing of data from hierarchical data sources (HDS).

The HDS API is a part of the JReport Data Access Model as shown in the following diagram:

The hierarchical data source API:

- Is a Java interface that provides a dataset to JReport.
- Has a PARAMETER string, which can be changed when the HDS object is added into JReport Designer. The result set may differ according to the PARAMETER string. It is very flexible and convenient.

Notes:

- The PARAMETER here is the parameter string given to the HDS interface. That is, the HDS API provides a method getResultSet (String strParam), and PARAMETER is string strParam in the above method. After reading the subsequent information on HDS API, this information will become clearer to you. As a note, we would like to remind you that PARAMETER here is different from that in a JReport catalog. To distinguish between them, we have used an upper case PARAMETER to refer to the parameter string in the HDS, and a lower case parameter for a parameter object in a catalog.
- To design a report, JReport requires meta data (See java.sql.ResultSetMetaData) which corresponds with the ResultSet that the data source has returned. To view or run a report, JReport requires a ResultSet object. The hierarchical data source must provide both of these two parts to JReport.

Go through the following topics for details about the HDS API:

- HDS API interfaces
- Examples of using the HDS API