JavaTM Platform
Standard Ed. 6

javax.sql.rowset
인터페이스 FilteredRowSet

모든 슈퍼 인터페이스:
CachedRowSet , Joinable , ResultSet , RowSet , WebRowSet , Wrapper


public interface FilteredRowSet
extends WebRowSet

FilteredRowSet 의 모든 표준 구현이 구현해야 하는 표준 인터페이스입니다. FilteredRowSetImpl 클래스는, 필요에 따라서 확장 가능한 레퍼런스 구현을 제공합니다. 벤더는, 이 인터페이스를 구현하는 것에 의해, 독자적인 버젼을 구현할 수 있습니다.

1.0 배경

RowSet 객체로, 어느 정도의 컨텐츠 필터링 기능을 제공해야 하는 경우가 있습니다. 이 경우, 1 개의 가능성이 있는 해결 방법으로서 모든 표준 RowSet 구현의 쿼리언어를 제공하는 방법이 있습니다. 그러나, 이것은 미접속의 RowSet 객체등의 경량 컴퍼넌트에는 현실적인 방법이 아닙니다. FilteredRowSet 인터페이스는, 방대한 쿼리언어와 거기에 따르는 처리를 제공하는 일 없이, 이 요구에 대응할 수 있을 필요가 있습니다.  

JDBC FilteredRowSet 표준 구현은,RowSet 인터페이스를 구현해,CachedRowSetTM 클래스를 확장합니다. CachedRowSet 클래스는, protected 커서 조작 메소드세트를 제공합니다. FilteredRowSet 구현은, 이러한 메소드를 오버라이드(override) 해, 필터링 기능을 제공할 수가 있습니다.

2.0 프레디케이트의 공유

친인터페이스로, 상속된 createShared 메소드를 사용해 FilteredRowSet 구현을 공유하고 있는 경우, 모든 FilteredRowSet 인스턴스의 복제로, 변경을 더하는 일 없이 프레디케이트를 공유할 필요가 있습니다.

3.0 용법

프레디케이트를 구현했을 경우 (프레디케이트크라스의 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 객체를 초기화하고 있습니다. 이 객체에는, 이 FilteredRowSet 객체로부터 출력 또는 변경된 모든 행이, columnName 렬내의 Alpha 로부터 Bravo 의 범위에 들어갈 필요가 있습니다. 필터의 범위내에 들어가는 데이터를 포함하지 않는 FilteredRowSet 객체에 필터가 적용되었을 경우는, 행이 돌려주어지지 않습니다.  

이 시스템에서는, 쿼리언어 처리를 이용하는 일 없이, predicate 를 구현하는 복수의 클래스를, 필요한 필터링 결과와 조합해 사용할 수가 있습니다.  

FilteredRowSet 객체의 갱신

FilteredRowSet 의 predicate 세트는,RowSet 객체내의 모든 행에 기준을 적용해,RowSet 객체내의 행의 부분집합을 관리합니다. 이 기준에서는, 가시의 행의 부분집합을 제어 가능할 뿐만 아니라, 행의 변경, 삭제, 또는 삽입의 기준을 정의할 수도 있습니다.  

따라서,FilteredRowSet 객체상의 predicate 세트는 쌍방향이라고 보여져 세트 기준은 FilteredRowSet 객체의 모든 뷰 및 갱신의 게이트 기구라고 보여집니다. 기준에 위반하는 FilteredRowSet 를 갱신하려고 하면(자),SQLException 객체가 throw 됩니다.

FilteredRowSet 범위 기준은,FilteredRowSet 인스턴스에, 새로운 프레디케이트객체를 적용하는 것으로, 언제라도 변경할 수 있습니다. 이 처리는,FilteredRowSet 객체에의 추가 참조가 검출되지 않는 경우도 실행 가능합니다. 새로운 필터는,FilteredRowSet 객체내의 기준의 적용에 즉시 영향을 미쳐, 후속의 모든 뷰 및 갱신에 같은 기준이 적용됩니다.  

5.0 필터 외부의 행의 동작

FilteredRowSet 객체로 설정된 필터의 범위외의 행은, 필터를 삭제하는지, 새로운 필터를 적용할 때까지 변경할 수 없습니다.

게다가 필터의 경계내에 들어가는 행만이, 데이터 소스와 동기 됩니다.


필드의 개요
 
인터페이스 javax.sql.rowset. WebRowSet 로부터 상속된 필드
PUBLIC_XML_SCHEMA , SCHEMA_SYSTEM_ID
 
인터페이스 javax.sql.rowset. CachedRowSet 로부터 상속된 필드
COMMIT_ON_ACCEPT_CHANGES
 
인터페이스 java.sql. ResultSet 로부터 상속된 필드
CLOSE_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
 
메소드의 개요
 Predicate getFilter ()
          이 FilteredRowSet 객체의 액티브한 필터를 가져옵니다.
 void setFilter (Predicate  p)
          이 FilteredRowSet 객체에, 지정된 프레디케이트객체를 적용합니다.
 
인터페이스 javax.sql.rowset. WebRowSet 로부터 상속된 메소드
readXml , readXml , writeXml , writeXml , writeXml , writeXml
 
인터페이스 javax.sql.rowset. CachedRowSet 로부터 상속된 메소드
acceptChanges , 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 , undoUpdate
 
인터페이스 javax.sql. RowSet 로부터 상속된 메소드
addRowSetListener , 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 , setUsername
 
인터페이스 java.sql. ResultSet 로부터 상속된 메소드
absolute , 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 , 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 , updateRef , updateRef , updateRow , updateRowId , updateRowId , updateShort , updateShort , updateSQLXML , updateSQLXML , updateString , updateString , updateTime , updateTime , updateTimestamp , updateTimestamp , wasNull
 
인터페이스 java.sql. Wrapper 로부터 상속된 메소드
isWrapperFor , unwrap
 
인터페이스 javax.sql.rowset. Joinable 로부터 상속된 메소드
getMatchColumnIndexes , getMatchColumnNames , setMatchColumn , setMatchColumn , setMatchColumn , setMatchColumn , unsetMatchColumn , unsetMatchColumn , unsetMatchColumn , unsetMatchColumn
 

메소드의 상세

setFilter

void setFilter(Predicate  p)
               throws SQLException 
FilteredRowSet 객체에, 지정된 프레디케이트객체를 적용합니다. 필터는, 착신 뷰와 송신 뷰의 양쪽 모두를 제어해, 가시의 행이나 조작 가능한 행을 제한합니다.  

새로운 프레디케이트객체는 언제라도 설정 가능합니다. 설정하면(자),RowSet 객체의 데이터에 부과된 제약이 변경됩니다. 또, 복수의 컴퍼넌트가 단일의 FilteredRowSet 로 처리되기 (위해)때문에, 실행시로 필터를 변경하면(자), 문제가 발생합니다. 어플리케이션 개발자는, 부하의 프레디케이트객체가 변경되었을 때,FilteredRowSet 객체의 복수의 핸들을 관리할 책임을 질 필요가 있습니다.

파라미터:
p - 이 FilteredRowSet 객체의 필터를 정의한다 프레디케이트객체. null 치를 설정하면(자), 프레디케이트를 소거해, 모든 행을 가시로 할 수 있다
예외:
SQLException - 프레디케이트객체의 설정시에 에러가 발생했을 경우

getFilter

Predicate  getFilter()
FilteredRowSet 객체의 액티브한 필터를 가져옵니다.

반환값:
p 이 FilteredRowSet 객체의 프레디케이트. 필터가 설정되어 있지 않은 경우는 null

JavaTM Platform
Standard Ed. 6

버그의 보고와 기능의 요청
한층 더 자세한 API 레퍼런스 및 개발자 문서에 대해서는,Java SE 개발자용 문서를 참조해 주세요. 개발자전용의 상세한 해설, 개념의 개요, 용어의 정의, 버그의 회피책, 및 코드 실례가 포함되어 있습니다.

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.