borland Packages  Class Hierarchy  dx.sql.dataset Package 

Load interface

com.borland.dx.sql.dataset.Load

About the Load interface

Variables  
The Load interface defines constants used to control how data is loaded into a DataSet. Values set in these editors are stored in the QueryDescriptor or ProcedureDescriptor object, as appropriate. Programmatically, set the loadOption property for the descriptor class for the QueryDataSet or ProcedureDataSet.

If any load option other than ALL is used, when Database.saveChanges() is called, the query is terminated and the JDBC ResultSet released. The only way to get additional data is to refetch the data. See the descriptions of each constant for additional information specific to that load option.


Load variables

Variables defined in this interface


Load variables

ALL

  public static final int ALL = 0
Load all data in a single fetch. The JDBC ResultSet is closed after use. Note that if the (StorageDataSet's) maxRows property is set, then only that number of rows are loaded; no other rows in the ResultSet will ever be loaded into the DataSet.

AS_NEEDED

  public static final int AS_NEEDED = 2
An initial number of rows is loaded. Then, whenever a navigation beyond the last loaded row is attempted, another set of rows are loaded. Enlarging a JdbTable or reducing the height of its rows so that there is additional space to display data does not cause additional rows to be loaded nor will moving to the last row of the grid using the scrollbar or the PgUp or PgDown keys.

The following actions cause an additional set of rows to be added:

The number of rows loaded at a time is controlled by the (StorageDataSet's) maxRows property at runtime and maxDesignRows property. If the maxRows property is not set (its default value is -1) when using this constant, 25 rows are loaded at a time.

When using this constant, a call to getRowCount() returns the number of rows loaded; it doesn't return the number of rows in the ResultSet. Similarly, locates perform the search on loaded rows only.

The JDBC ResultSet is kept open until all the data is loaded. There is no notification that there are additional rows to be loaded.

ASYNCHRONOUS

  public static final int ASYNCHRONOUS = 1
A new thread is created for executing the query and fetching the results. This can yield better performance. However, running the query in a separate thread could introduce the possibility of a dead-lock.

Note: Running a query asynchronously may cause some methods to fail if all of the rows have not been retrieved. For example, your code might ask for rows that are not yet retrieved by the thread executing the query and therefore display an error about an empty DataSet, a call to getRowCount() could return 0, and so on. To determine if a query has completed executing, call the LoadListener.dataLoaded(com.borland.dx.dataset.LoadEvent) method before executing your code that depends on the data being there. You can also call the StorageDataSet.closeProvider(true) method to cause JDataStore to fetch any remaining rows.

UNCACHED

  public static final int UNCACHED = 4
Initially, one row is loaded. Whenever a navigation beyond the loaded row is attempted, another row is loaded that replaces the previously loaded row. The DataSet will keep changes as normal. The JDBC ResultSet is kept open until the last record is read.

The description for AS_NEEDED applies to this constant as well, except that the number of rows loaded in this case, is one.