toolkit.db.api
Interface SQLStmtCreator


public interface SQLStmtCreator

Normally, you import tables/views from DB to JReort Catalog and then build PSQL queries based on that catalog using JReport Query Editor. So at runtime, JReport Engine will execute those queries and fetch data from the pre-defined tables/views, and using the pre-defined search conditions, etc. But sometimes you may want to re-specify those infos at runtime. For example, fetch data from other tables instead of those predefined in JReport Catalog, re-define some search conditions or joins. Class SQLStmtCreator give you the chance to do so.
If you implement this interface and enable a PSQL query to get SQL statement from users, JReport Engine will ask you to create the SQL statement that will passed to DB by calling SQLStmtCreator.getSQLStmt(QueryInfo).
Note: in order to use Class.forName() to create a new Class instance for the class implements SQLStmtCreator, any implemented class must have a default constructor.


Method Summary
 java.lang.String getSQLStmt(QueryInfo queryInfo)
          Create a SQL statement string.
 

Method Detail

getSQLStmt

java.lang.String getSQLStmt(QueryInfo queryInfo)
Create a SQL statement string.

Parameters:
psqlQueryInfo - The psql query infomations that based on to create SQL string.
Returns:
SQL statement string that will be passed to DB.