public interface FilteredRowSet extends WebRowSet
FilteredRowSet所有标准的实现必须实现的标准接口。的
FilteredRowSetImpl类提供了参考实现可扩展的需要。另外,一个供应商可以自由地实现自己的版本,通过实施这个接口。
RowSet对象需要提供一定程度的过滤内容。一个可能的解决方案是所有标准
RowSet实现提供一种查询语言;然而,这是轻量级的组件如断线的
RowSet对象不切实际的方法。的
FilteredRowSet界面旨在满足这一需求而提供一个重量级的查询语言随着处理这样的查询语言要求。
JDBC FilteredRowSet标准贯彻实施RowSet接口和扩展CachedRowSet™类。的CachedRowSet类提供了一套保护光标操作方法,这一FilteredRowSet实现可以重写提供过滤支持。
FilteredRowSet使用继承的方法实现
createShared母接口共享,要共享的
Predicate无所有
FilteredRowSet克隆改造实例。
通过实施Predicate(在Predicate类Javadoc见例子),一个FilteredRowSet又可以描述如下。
FilteredRowSet frs = new FilteredRowSetImpl();
frs.populate(rs);
Range name = new Range("Alpha", "Bravo", "columnName");
frs.setFilter(name);
frs.next() // only names from "Alpha" to "Bravo" will be returned
在上面的例子中,我们初始化一个
Range对象实施
Predicate接口。该对象表示以下约束:所有行输出或从
FilteredRowSet对象修改必须下降值α和“Bravo”价值观之间的包容性,在列的列名”。如果过滤器被应用到一个
FilteredRowSet对象不包含数据,属于过滤范围,不返回任何行。
该框架允许多个类实现谓词组合使用,以实现所需的过滤结果与查询语言处理的需要。
FilteredRowSet对象FilteredRowSet对象的谓词应用在
RowSet对象管理
RowSet对象中的行的子集的所有行的标准。此标准管理是可见的行的子集,也定义可以修改、删除或插入的行的子集。
因此,谓语放在FilteredRowSet对象必须被视为门控机制的所有视图和更新的FilteredRowSet对象双向和设定的标准。任何试图更新FilteredRowSet违反准则将导致被SQLException对象。
的FilteredRowSet范围准则可以随时到FilteredRowSet实例应用新Predicate对象修改。如果没有额外的引用对象的FilteredRowSet检测这是可能的。一个新的过滤器有立竿见影的效果,对规范执法FilteredRowSet对象内,和随后的所有观点和更新将受到类似的执法。
FilteredRowSet对象不能被修改直到过滤器是除去或应用一个新的过滤器外。
此外,只有在过滤器的范围内下降的行将与数据源同步。
PUBLIC_XML_SCHEMA, SCHEMA_SYSTEM_IDCOMMIT_ON_ACCEPT_CHANGESCLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE| Modifier and Type | Method and Description |
|---|---|
Predicate |
getFilter()
检索此
FilteredRowSet对象的有源滤波器。
|
void |
setFilter(Predicate p)
适用于给定的
Predicate反对这
FilteredRowSet对象。
|
readXml, readXml, writeXml, writeXml, writeXml, writeXmlacceptChanges, acceptChanges, columnUpdated, columnUpdated, commit, createCopy, createCopyNoConstraints, createCopySchema, createShared, execute, getKeyColumns, getOriginal, getOriginalRow, getPageSize, getRowSetWarnings, getShowDeleted, getSyncProvider, getTableName, nextPage, populate, populate, previousPage, release, restoreOriginal, rollback, rollback, rowSetPopulated, setKeyColumns, setMetaData, setOriginalRow, setPageSize, setShowDeleted, setSyncProvider, setTableName, size, toCollection, toCollection, toCollection, undoDelete, undoInsert, undoUpdateaddRowSetListener, clearParameters, execute, getCommand, getDataSourceName, getEscapeProcessing, getMaxFieldSize, getMaxRows, getPassword, getQueryTimeout, getTransactionIsolation, getTypeMap, getUrl, getUsername, isReadOnly, removeRowSetListener, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBlob, setBlob, setBlob, setBoolean, setBoolean, setByte, setByte, setBytes, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setClob, setClob, setClob, setCommand, setConcurrency, setDataSourceName, setDate, setDate, setDate, setDate, setDouble, setDouble, setEscapeProcessing, setFloat, setFloat, setInt, setInt, setLong, setLong, setMaxFieldSize, setMaxRows, setNCharacterStream, setNCharacterStream, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNClob, setNClob, setNClob, setNString, setNString, setNull, setNull, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setObject, setPassword, setQueryTimeout, setReadOnly, setRef, setRowId, setRowId, setShort, setShort, setSQLXML, setSQLXML, setString, setString, setTime, setTime, setTime, setTime, setTimestamp, setTimestamp, setTimestamp, setTimestamp, setTransactionIsolation, setType, setTypeMap, setURL, setUrl, setUsernameabsolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, close, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getHoldability, getInt, getInt, getLong, getLong, getMetaData, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getRow, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getStatement, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, next, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNullisWrapperFor, unwrapgetMatchColumnIndexes, getMatchColumnNames, setMatchColumn, setMatchColumn, setMatchColumn, setMatchColumn, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn, unsetMatchColumnvoid setFilter(Predicate p) throws SQLException
Predicate反对这
FilteredRowSet对象。该过滤器将控件应用于对入站和出站视图的控件,约束哪些行是可见的,哪些行可以被操纵。
一个新的Predicate对象可以在任何时间。这改变了约束的RowSet对象的数据的影响。此外,在运行时修改了多个组件过滤问题可能是一FilteredRowSet对象操作。应用程序开发人员必须管理多个处理FilteredRowSet对象当下属Predicate对象变化的责任。
p -
Predicate对象定义这个
FilteredRowSet对象过滤器。设置一个
价值将清楚谓语,让所有行变得可见。
SQLException -如果出现错误设置
Predicate对象时
Predicate getFilter()
FilteredRowSet对象的有源滤波器。
FilteredRowSet对象的
Predicate;
null如果没有过滤器已定。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.