borland Packages  Class Hierarchy  dx.sql.dataset Package 

QueryProvider component

java.lang.Object
   +----com.borland.dx.dataset.Provider
           +----com.borland.dx.sql.dataset.JdbcProvider
                   +----com.borland.dx.sql.dataset.QueryProvider

About the QueryProvider component

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.


QueryProvider constructors

QueryProvider properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in com.borland.dx.sql.dataset.JdbcProvider

Properties implemented in java.lang.Object

QueryProvider methods

Methods implemented in this class

Methods implemented in com.borland.dx.dataset.Provider

Methods implemented in com.borland.dx.sql.dataset.JdbcProvider

Methods implemented in java.lang.Object


QueryProvider constructors

QueryProvider()

  public QueryProvider()
Creates a QueryProvider object.

QueryProvider properties

parameterRow

 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.

query

 public final QueryDescriptor getQuery()
 public final void setQuery(QueryDescriptor queryDescriptor)
The QueryDescriptor object that contains query properties.

QueryProvider methods

checkMasterLink(com.borland.dx.dataset.StorageDataSet, com.borland.dx.dataset.MasterLinkDescriptor)

  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.

Overrides: com.borland.dx.dataset.Provider.checkMasterLink(com.borland.dx.dataset.StorageDataSet, com.borland.dx.dataset.MasterLinkDescriptor)

executeStatement(com.borland.dx.sql.dataset.Database, java.lang.String, com.borland.dx.dataset.ReadWriteRow)

  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);

Parameters:

database
The Database object associated with the query.
statement
The query statement to execute.
parameters
The ReadWriteRow implementation that stores values for the query parameters.

For more information on other methods that execute statements, see "Executing queries" in the About section of the QueryDescriptor class.

executeStatement(com.borland.dx.sql.dataset.Database, java.lang.String, com.borland.dx.dataset.ReadWriteRow[])

  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.

Parameters:

database
The Database object associated with the query.
statement
The query statement to execute.
parameters
An array of ReadWriteRow objects that store values for the query parameters. For example,
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.

getQueryString(com.borland.dx.dataset.StorageDataSet)

  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.