DataSourceQuery¶
-
class
DataSourceQuery
extends DataSourceProcess¶ DataSourceQuery is a data source DAO process which handles a SQL query process.
Author: Hugo Y. K. Lam
Constructors¶
DataSourceQuery¶
-
DataSourceQuery
(DataSourceDAO dao, DataSourceTransaction transaction, String sql, Object[] params)¶ Creates a new instance of DataSourceQuery.
Parameters: - dao – the DAO to which this process correspond.
- transaction – the transaction for this process.
- sql – the SQL query statement.
- params – the parameter values used by the specified SQL statement. The number, format, and sequence of the parameter values should match the statement. null if there is no parameter for the statement.
Methods¶
doTransaction¶
-
protected void
doTransaction
(DataSourceTransaction tx)¶ Executes the query and stores the result as a list of DataSourceDVO or raw data list.
Throws: - DAOException – if unable to execute the query.
See also:
hk.hku.cecid.piazza.commons.dao.ds.DataSourceProcess.doTransaction(DataSourceTransaction)
isRawResult¶
-
public boolean
isRawResult
()¶ Checks if the result data is in raw format.
Returns: true if the result data is in raw format. See also:
.setRawResult(boolean)
setRawResult¶
-
public void
setRawResult
(boolean isRawResult)¶ Sets whether the result data should be in raw format. If true, the result data will be a list of DataSourceDVO. Otherwise, it will be a list of list which contains the data values in order with the query.
Parameters: - isRawResult – true if the result data should be in raw format.