home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-18 | 5.6 KB | 140 lines |
- /*
- * Copyright (c) 1997 Krumel & Associates, Inc. All Rights Reserved.
- *
- * www.krumel.com - controls@krumel.com
- *
- * Permission is given to the buyer of this package for one software
- * developer to use this software on one CPU (one workstation) and to make
- * one backup copy. You may uitilize and/or modify this class for use in your
- * projects. You may distribute or sell any executable which results from
- * using this code in yur application, except a utility or class of similar
- * nature to this product. You may distribute this product in compiled
- * form only, but soley to be used with your cmpiled executable product
- * for the puposes of dynamic loading. You may NOT redistribute the source
- * code in any form or make it accessible through a network or other
- * distribution media to others. Please refer to the file "copyright.html"
- * for further important copyright and licensing information.
- *
- * The source code is the confidential and proprietary information
- * of Krumel & Associates, Inc. ("Confidential Information"). You shall
- * not disclose such Confidential Information and shall use it only in
- * accordance with the terms of the license agreement you entered into
- * with Krumel & Associates, Inc..
-
- * KRUMEL & ASSOCIATES MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
- * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT
- * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. 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 extends java.io.Serializable {
- /**
- * 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 TableView 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 TableView 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 TypeNotSupported
- * if the data store does not support the type of action requested
- * or is not successful
- */
- public void update(int row, int col, Data data) throws TypeNotSupported;
-
- /**
- * Requests the data store get the values from the database again.
- */
- public void refresh();
-
- /**
- * Requests that any actions performed on a row be undone. The meaning
- * is left open and is interpreted as appropriate for the type of
- * data store.
- *
- * @param row the zero-relative row index
- * @exception TypeNotSupported
- * if the data store does not support the type of action requested
- * or is not successful
- */
- 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;
- }
-