borland Packages Class Hierarchy dx.sql.dataset Package
java.lang.Object +----com.borland.dx.dataset.Provider +----com.borland.dx.sql.dataset.JdbcProvider +----com.borland.dx.sql.dataset.QueryProvider
Constructors Properties Methods
Implements Designable, LoadCancel, ConnectionUpdateListener, Task, Serializable, EventListener
The QueryProvider component is used to provide data to a DataSet by running a query through JDBC. This component is also a place holder for static methods for executing statements with parameters (see executeStatement()).
For information on performance tuning when executing queries, see "Fine tuning query performance" in the About section of the QueryDataSet component.
public QueryProvider()Creates a QueryProvider object.
public ReadWriteRow getParameterRow() public void setParameterRow(ReadWriteRow value)The ReadWriteRow that is used to fill in parameter values for parameterized queries or stored procedures for StorageDataSet extensions such as QueryDataSet and ProcedureDataSet.
public final QueryDescriptor getQuery() public final void setQuery(QueryDescriptor queryDescriptor)The QueryDescriptor object that contains query properties.
public void checkMasterLink(StorageDataSet dataSet, MasterLinkDescriptor masterLink)Validates the masterLink property. When the MasterLinkDescriptor's fetchAsNeeded property is enabled (true), this method checks if there is a WHERE clause in the query. If no WHERE clause is specified, a DataSetException is thrown.
public static final int executeStatement(Database database, String statement, ReadWriteRow parameters)Executes the SQL statement specified as statement and passes values to the parameter markers in the SQL statement (all named or unnamed) with values from the ReadWriteRow. Use this method to execute SQL statements with parameters that do not yield a ResultSet. For example:
QueryProvider.executeStatement(db1,"INSERT INTO CUST VALUES (?,?)", paramRow);
For more information on other methods that execute statements, see "Executing queries" in the About section of the QueryDescriptor class.
public static final int executeStatement(Database database, String statement, ReadWriteRow[] parameters)Similar to executeStatement(com.borland.dx.sql.dataset.Database, java.lang.String, com.borland.dx.dataset.ReadWriteRow), but allows for an array of query parameters.
QueryProvider.executeStatement(db1,"INSERT INTO CUST (FIRST_NAME,LAST_NAME) VALUES (:1.NAME,:2.NAME)", new ReadWriteRow[] {paramRow1,paramRow2});
Where tags "1." and "2." in front of the named parameter specifies which query parameter row to find the value from. If no tags are given, the parameter names are found by searching the parameter rows from left to right.
public final String getQueryString(StorageDataSet sds)Returns the query String associated with this QueryDataSet. This property is a short cut to the queryString property of the QueryDescriptor object.