The dynamic query interface

The dynamic query interface SQLStmtCreator is stored in the archive file - JREngine.jar in <install_root>\lib. It is contained in the package toolkit.db.api, and can be applied to any existing query in a catalog.

How the dynamic query interface works

The following flowchart illustrates how the interface works when creating a dynamic query. The QueryInfo object is passed from the JReport Engine to the interface as an input. Then, the completed SQL statement is returned from the interface. Finally, the completed SQL statement is sent to the database to get the result set for the report.

Method of the dynamic query interface

This interface is very simple with only one method: getSQLStmt(QueryInfo queryInfo);

It receives information of a query and returns an SQL string. QueryInfo is a container that contains all information to build an SQL string. Users can call getXXX() methods to get all information step by step.

The structure of QueryInfo is as follows:

Reference: See JReport Javadoc toolkit.db.api.SQLStmtCreator interface in <install_root>\help\api.