home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-06-19 | 3.9 KB | 110 lines |
- /*
- * DbDataStore.java 1.0 12 Jan 1997
- *
- * Copyright (c) 1996 Krumel & Associates, Inc. All Rights Reserved.
- *
- * This software is provided as is. Krumel & Associates shall not be liable
- * for any damages suffered by licensee as a result of using, modifying or
- * distributing this software or its derivatives.
- */
-
- package symantec.itools.db.awt;
-
- /**
- * Interface defines the APIs required by classes that act a source of data
- * for a DbDataSource. Norally, implementors of this interface read data from
- * a SQL query. When a DbDataStore is set in a DbDataSource, the source will
- * query whether the store caches data. If not, the data source will perform
- * data caching. Data source caching would be required for JDBC type stores
- * since JDBC does not support scrollable cursors. This interface is designed
- * to work in conjunction with the DbUpdater and MetaTable interfaces.<p>
- * All rows coming from DbDataSource are 0 relative<br>
- * All cols coming from DbDataSource are 1 relative
- *
- */
- public interface DbDataStore {
- /**
- * Sets the database data source that requests data and possibly
- * caches the SQL data.
- */
- public void setDbDataSource(DbDataSource ds);
-
- /**
- * Called by a DbDataSource to determine if the store provides its own
- * caching services.
- * @return true if the cache provides scrollable caching.
- */
- public boolean supportsCaching();
-
- /**
- * Sets the fetch mode for getting data. When fetch mode is enabled,
- * a grid expects to rapidly read lots of data for read only purposes.
- * Knowing this can allow some data stores to more efficiently get the
- * data. The Grid provides a guarentee that the current data row will
- * not be changed
- * @param mode true if fetch mode is to be entered
- */
- public void fetchMode(boolean mode);
-
- /**
- * Gets the last row that exists within the specified range.
- * @param top The first row in the range
- * @param bottom The last row in the range
- * @exception DataNotAvailable The requested data is not present
- */
- public int validDataRowRange(int top, int bottom) throws DataNotAvailable;
-
- /**
- * Gets the data element for the specified result set position
- * @exception DataNotAvailable The requested data is not present
- */
- public Data getData(int row, int col) throws DataNotAvailable;
-
- /**
- * Sets a new value in a result set position. The method is only
- * called when the store supports caching.
- * @param row The row to update
- * @param col The column to update
- * @param data The data element that holds the new value
- * @exception DataNotAvailable The requested data is not present
- */
- public void update(int row, int col, Data data) throws TypeNotSupported;
-
- /**
- * Requests the data store get the values from the database again.
- * @exception TypeNotSupported If the data source does not support the type of
- * action requested or is not successful
- */
- public void refresh();
-
- public void undoRow(int row) throws TypeNotSupported;
-
- /**
- * Requests the data store clear all cached data.
- */
- public void clear();
-
- /**
- * Gets the number of rows actually retrieved from the database.
- */
- public int rowsRetrieved();
-
- /**
- * Requests the store to get all of the elements in the result set.
- */
- public int fetchAllRows();
-
- /**
- * Gets the state of the specified row number as defined in the RowState class
- */
- public int rowState(int row);
-
- /**
- * Sets the current row in the data store.
- * @exception TypeNotSupported If the data source does not support the type of
- * action requested or is not successful
- */
- public void setCurrentRow(int row) throws TypeNotSupported;
-
- public Object getSynchronizationObject();
- }