001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package javax.sql.rowset;
019:
020: import java.sql.Connection;
021: import java.sql.ResultSet;
022: import java.sql.SQLException;
023: import java.sql.Savepoint;
024: import java.util.Collection;
025: import javax.sql.RowSet;
026: import javax.sql.RowSetEvent;
027: import javax.sql.RowSetMetaData;
028: import javax.sql.rowset.spi.SyncProvider;
029: import javax.sql.rowset.spi.SyncProviderException;
030:
031: public interface CachedRowSet extends Joinable, ResultSet, RowSet {
032: boolean COMMIT_ON_ACCEPT_CHANGES = true;
033:
034: void populate(ResultSet data) throws SQLException;
035:
036: void execute(Connection conn) throws SQLException;
037:
038: void acceptChanges() throws SyncProviderException;
039:
040: void acceptChanges(Connection con) throws SyncProviderException;
041:
042: void restoreOriginal() throws SQLException;
043:
044: void release() throws SQLException;
045:
046: void undoDelete() throws SQLException;
047:
048: void undoInsert() throws SQLException;
049:
050: void undoUpdate() throws SQLException;
051:
052: boolean columnUpdated(int idx) throws SQLException;
053:
054: boolean columnUpdated(String columnName) throws SQLException;
055:
056: Collection<?> toCollection() throws SQLException;
057:
058: Collection<?> toCollection(int column) throws SQLException;
059:
060: Collection<?> toCollection(String column) throws SQLException;
061:
062: SyncProvider getSyncProvider() throws SQLException;
063:
064: void setSyncProvider(String provider) throws SQLException;
065:
066: int size();
067:
068: void setMetaData(RowSetMetaData md) throws SQLException;
069:
070: ResultSet getOriginal() throws SQLException;
071:
072: ResultSet getOriginalRow() throws SQLException;
073:
074: void setOriginalRow() throws SQLException;
075:
076: String getTableName() throws SQLException;
077:
078: void setTableName(String tabName) throws SQLException;
079:
080: int[] getKeyColumns() throws SQLException;
081:
082: void setKeyColumns(int[] keys) throws SQLException;
083:
084: RowSet createShared() throws SQLException;
085:
086: CachedRowSet createCopy() throws SQLException;
087:
088: CachedRowSet createCopySchema() throws SQLException;
089:
090: CachedRowSet createCopyNoConstraints() throws SQLException;
091:
092: RowSetWarning getRowSetWarnings() throws SQLException;
093:
094: boolean getShowDeleted() throws SQLException;
095:
096: void setShowDeleted(boolean b) throws SQLException;
097:
098: void commit() throws SQLException;
099:
100: void rollback() throws SQLException;
101:
102: void rollback(Savepoint s) throws SQLException;
103:
104: void rowSetPopulated(RowSetEvent event, int numRows)
105: throws SQLException;
106:
107: void populate(ResultSet rs, int startRow) throws SQLException;
108:
109: void setPageSize(int size) throws SQLException;
110:
111: int getPageSize();
112:
113: boolean nextPage() throws SQLException;
114:
115: boolean previousPage() throws SQLException;
116: }
|