## User data source API

As a database application, JReport Designer can access data stored in a database through a JDBC connection. However, through the user data source API, JReport Designer can also access data from an external data source, such as a text file, or Lotus Notes, which is not stored in a database, or when there is no JDBC driver available.

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

The user data source API:

- Is a Java interface that provides a dataset to JReport.
- Has a PARAMETER string, which can be changed when the UDS 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 UDS interface. That is, the UDS API provides a function getResultSet (String strParam), and PARAMETER is string strParam in this function. The following topics about UDS API will help make this information more clear. As a reminder, PARAMETER here is different from the parameter object in the JReport catalog. To distinguish between them, we have used an upper case PARAMETER to refer to the parameter string in the UDS, and a lower case parameter for the parameter object in a catalog.
- To design a report, JReport requires a meta data (see java.sql.ResultSetMetaData) which corresponds to the ResultSet that the data source has returned. To view or run a report, JReport requires a ResultSet object. The user data source must provide both of these two parts for JReport.

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

- USD API interface
- JDBC API used by UDS
- Examples of using the UDS API