borland Packages  Class Hierarchy  sql.dataset Package  Index 

Load interface

borland.sql.dataset.Load

About the Load interface

Variables  
The Load interface defines constants used to control how data is loaded into a DataSet. These constants are used for the Load Option field of the Query and Procedure property editors (which are accessed from the JBuilder Inspector). 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 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 GridControl 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. Through the UI, the following actions cause an additional set of rows to be added:

Similarly, the following have the same effect programmatically

The number of rows loaded at a time is controlled by the maxRows property at runtime and maxDesignRows property in the UI Designer. 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.

UNCACHED

  public static final int UNCACHED = 3
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.