borland Packages Class Hierarchy dx.dataset Package
java.lang.Object +----com.borland.dx.dataset.Provider +----com.borland.dx.sql.dataset.DataModelProvider +----com.borland.dx.sql.dataset.JdbcProvider
Properties Methods
Implements Designable, Serializable
The Provider
class is an abstract base class that "provides" (or populates) a DataSet
with data.
Extend this class if you want to create a custom provider. The instantiable subclasses
(technically, subclasses of its JDBCProvider subclass) QueryProvider
and ProcedureProvider
are included. These classes
collect provider functionality using queries and stored procedures on JBDC data sources.
For an example of a custom provider that extends this class, see the ProviderBean class in the sample project CustomProviderResolver.jpr. This sample is located in the providers sample folder of your JBuilder installation. For another example of writing a custom provider, see the sample project StreamableDataSets.jpr located in the DataExpress/StreamableDataSets samples folder of 1your JBuilder installation. The ClientProvider.java class in this sample application discusses building a custom provider that uses RMI to make a remote method call to load data into a DataSet
. (These samples only run with JBuilder Enterprise.)
The HTML files in these project, and the "Retrieving data from a data source" chapter in the Database Application Developer's Guide contain valuable information on creating a custom provider.
public boolean isAccumulateResults()Return false if new data provide requests should empty the associated
StorageDataSet
. Return true if new data provide requests should leave existing rows in the associated StorageDataSet
.
public ReadWriteRow getParameterRow() public void setParameterRow(ReadWriteRow value)This is the
parameterRow
that will be used by extensions of StorageDataSet
, like QueryDataSet
and ProcedureDataSet
, to fill in parameter values for parameterized queries or stored procedures. If a TableDataSet
extension of StorageDataSet
has a QueryProvider
or ProcedureProvider
, this property will also be used by those providers to fill in parameter values for parameterized queries or stored procedures.
public void checkIfBusy(StorageDataSet dataSet)Some implementations of the
provideData
method may optionally provide the data asynchronously. A StorageDataSet
has to block actions such as resolving until the asynchronous data is present. This method allows an implementation to give an appropriate error message by raising a DataSetException
. The default action is to do nothing, i.e. no asynchronous providing.
public void checkMasterLink(StorageDataSet dataSet, MasterLinkDescriptor masterLink)Called to validate the
masterLink
property.
When the MasterLinkDescriptor's
fetchAsNeeded
property is enabled (true),
the QueryProvider
uses this method to check if there is a WHERE clause in the query.
If no WHERE clause is specified, the QueryProvider
throws a DataSetException
.
public void close(StorageDataSet dataSet, boolean loadRemainingRows)Releases resources kept for loading data on demand.
StorageDataSet
calls this method when the
storage is being closed and when calling StorageDataSet.closeProvider
. The loadRemainingRows
parameter controls whether the rest of the data (if more data is available) is loaded or not.
public boolean hasMoreData(StorageDataSet dataSet)Some implementations of a
Provider
may allow to provide part of the data, then load
more data on demand. This method should return true if there is more data
to be loaded. To load the data, call the provideMoreData
method.
StorageDataSet
will attempt to retrieve more data in the following three cases:
dataSet.next()
goes past the last record.
dataSet.last()
is called.
Provider.hasMoreData()
is called. If it returns true, Provider.provideMoreData()
is called.
public abstract void provideData(StorageDataSet dataSet, boolean toOpen)Provides the data for a
DataSet
. The source of the data, and the method of retrieving the data is up
to the implementation of this abstract method. The toOpen
parameter indicates whether this method
is called as part of opening this StorageDataSet
.
public void provideMoreData(StorageDataSet dataSet)Some implementations of a
Provider
may allow to provide part of the data and then load more data
on demand. This method provides more data if there is more data to be loaded. If no more data is available,
this method simply returns.
StorageDataSet
will attempt to retrieve more data in the following three cases:
dataSet.next()
goes past the last record.
dataSet.last()
is called.
Provider.hasMoreData()
is called. If it returns true, Provider.provideMoreData()
is called.