borland Packages Class Hierarchy dx.sql.dataset Package
com.borland.dx.sql.dataset.Load
Variables
The Load
interface defines constants used to control how data is loaded
into a DataSet
. These constants are used for the Load Options field of the Query and Procedure property editors (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.
public static final int ALL = 0Load 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
.
public static final int AS_NEEDED = 2An 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.
Through the UI, the following actions cause an additional set of rows to be added:
JdbNavToolBar's
Next button when positioned on the last row
JdbNavToolBar's
Last button
Similarly, the following have the same effect programmatically
DataSet.next()
when positioned on the last row
DataSet.last()
DataSet.goToRow(int)
past the last row
The number of rows loaded at a time is controlled by the (StorageDataSet's
)
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.
public static final int ASYNCHRONOUS = 1A 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.
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 fetch any remaining rows.
public static final int UNCACHED = 4Initially, 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.