JavaTM Platform
Standard Ed. 6

javax.sql.rowset
인터페이스 WebRowSet

모든 슈퍼 인터페이스:
CachedRowSet , Joinable , ResultSet , RowSet , Wrapper
기존의 서브 인터페이스의 일람:
FilteredRowSet , JoinRowSet


public interface WebRowSet
extends CachedRowSet

WebRowSet 의 모든 구현이 구현해야 하는 표준 인터페이스입니다.  

1.0 개요

WebRowSetImpl 는, 필요에 따라서 확장 가능한 표준 레퍼런스 구현을 제공합니다.  

표준 WebRowSet XML schema 정의는, 다음의 URI 로 확인할 수 있습니다.

이 schema 정의는, XML 로 RowSet 를 기술할 경우에 필요한 표준 XML 문서 형식에 대해 기술한 것입니다. 상호 운용성을 얻기 위해서(때문에)는,WebRowSet 인터페이스의 모든 표준 구현으로, 이 schema 정의를 사용할 필요가 있습니다. WebRowSet schema는 고유의 SQL/XML schema 주석을 사용하므로, 플랫폼간의 상호 운용성이 한층 더 향상합니다. 덧붙여 이 schema 정의는, ISO 내에서 현재 개발중입니다. SQL/XML 정의는, 다음의 URI 로 확인할 수 있습니다. 이 schema 정의는,RowSet 객체의 내부 데이터를 다음의 3 개의 영역으로부터 기술합니다.

2.0 WebRowSet 상태

이하에서는,WebRowSet 구현으로, XML schema를 사용해, 갱신, 삽입, 또는 삭제 조작을 기술해, XML 에서의 WebRowSet 객체 상태를 기술하는 방법에 대해 구체적으로 설명합니다.  

2.1 상태 1 - WebRowSet 객체의 XML 에서의 출력

이 예에서는,WebRowSet 객체가, 데이터 소스로부터, 2 열 × 5 행의 단순한 겉(표) 형식에서 생성됩니다. WebRowSet 객체에 5 행 있기 (위해)때문에, 그것들을 XML 로 기술할 수 있습니다. RowSet 인터페이스에 정의된 다양한 표준 JavaBeans 프로퍼티과CachedRowSetTM 인터페이스에 정의된 표준 프로퍼티을 기술하는 메타데이타에 의해, WebRowSet 프로퍼티을 기술하는 주된 상세 정보가 제공됩니다. 표준 writeXml 메소드를 사용해 WebRowSet 객체를 XML 로 출력했을 경우, 내부 프로퍼티은 다음과 같이 기술됩니다.
 <properties>
       <command>select co1, col2 from test_table</command>
        <concurrency>1</concurrency>
        <datasource/>
        <escape-processing>true</escape-processing>
        <fetch-direction>0</fetch-direction>
        <fetch-size>0</fetch-size>
        <isolation-level>1</isolation-level>
        <key-columns/>
        <map/>
        <max-field-size>0</max-field-size>
        <max-rows>0</max-rows>
        <query-timeout>0</query-timeout>
        <read-only>false</read-only>
        <rowset-type>TRANSACTION_READ_UNCOMMITED</rowset-type>
        <show-deleted>false</show-deleted>
        <table-name/>
        <url>jdbc:thin:oracle</url>
        <sync-provider>
                <sync-provider-name>.com.rowset.provider.RIOptimisticProvider</sync-provider-name>
                <sync-provider-vendor>Sun Microsystems</sync-provider-vendor>
                <sync-provider-version>1. 0</sync-provider-name>
                <sync-provider-grade>LOW</sync-provider-grade>
              <data-source-lock>NONE</data-source-lock>
        </sync-provider>
 </properties> 
 
WebRowSet 의 구성을 기술하는 메타데이타는, XML 로 기술됩니다 (자세한 것은 아래와 같이). 양쪽 모두의 열이 column-definition 태그내에 기술되고 있는 점에 주목해 주세요.
 <metadata>
        <column-count>2</column-count>
        <column-definition>
                <column-index>1</column-index>
                <auto-increment>false</auto-increment>
                <case-sensitive>true</case-sensitive>
                <currency>false</currency>
                <nullable>1</nullable>
                <signed>false</signed>
                <searchable>true</searchable>
                <column-display-size>10</column-display-size>   
                <column-label>COL1</column-label>
                <column-name>COL1</column-name>
                <schema-name/>
                <column-precision>10</column-precision>
                <column-scale>0</column-scale>
                <table-name/>
                <catalog-name/>
                <column-type>1</column-type>
                <column-type-name>CHAR</column-type-name>
        </column-definition>
        <column-definition>
                <column-index>2</column-index>
                <auto-increment>false</auto-increment>
                <case-sensitive>false</case-sensitive>
                <currency>false</currency>
                <nullable>1</nullable>
                <signed>true</signed>
                <searchable>true</searchable>
                <column-display-size>39</column-display-size>
                <column-label>COL2</column-label>
                <column-name>COL2</column-name>
                <schema-name/>
                <column-precision>38</column-precision>
                <column-scale>0</column-scale>
                <table-name/>
                <catalog-name/>
                <column-type>3</column-type>
                <column-type-name>NUMBER</column-type-name>
        </column-definition>
 </metadata>
 
프로퍼티과 메타데이타의 기술 내용을 확인했더니, 다음에 WebRowSet 객체의 컨텐츠를 XML 로 기술하는 방법에 대해 보고 갑니다. 이하는, 인스턴스를 생성하고 나서 일절 변경되어 있지 않은 WebRowSet 객체의 기술입니다. currentRow 태그는,WebRowSet 객체의 겉(표) 구조의 각 행에 대응하고 있습니다. columnValue 태그에는, XML 치의 맵처의 SQL 형에 의해,stringData 또는 binaryData 태그가 들어갑니다. binaryData 태그는, 일반적으로,BLOB 또는 CLOB 형 데이터용입니다. 여기에는, Base64 encode 방식의 데이터가 들어갑니다.
 <data>
        <currentRow>
                <columnValue>
                        firstrow
                </columnValue>
                <columnValue>
                        1
                </columnValue>
        </currentRow>
        <currentRow>
                <columnValue>
                        secondrow
                </columnValue>
                <columnValue>
                        2
                </columnValue>
        </currentRow>
        <currentRow>
                <columnValue>
                        thirdrow
                </columnValue>
                <columnValue>
                        3
                </columnValue>
        </currentRow>
        <currentRow>
                <columnValue>
                        fourthrow
                </columnValue>
                <columnValue>
                        4
                </columnValue>
        </currentRow>
 </data>
 

2.2 상태 2 - 행의 삭제

WebRowSet 객체의 행의 삭제에서는, 다른 RowSet 객체와 같게, 단지 삭제하는 행으로 이동해,deleteRow 메소드를 호출할 뿐입니다. 다음의 2 행의 코드 (이 안에서는 wrsWebRowSet 객체)로 3 행 째를 삭제합니다.
     wrs.absolute(3);
     wrs.deleteRow();
 
XML 의 기술에서는, 3 행 째에 deleteRow 라고 하는 마크가 뒤따라 WebRowSet 객체의 3 행 째가 배제됩니다.
 <data>
        <currentRow>
                <columnValue>
                        firstrow
                </columnValue>
                <columnValue>
                        1
                </columnValue>
        </currentRow>
        <currentRow>
                <columnValue>
                        secondrow
                </columnValue>
                <columnValue>
                        2
                </columnValue>
        </currentRow>
        <deleteRow>
                <columnValue>
                        thirdrow
                </columnValue>
                <columnValue>
                        3
                </columnValue>
        </deleteRow>
        <currentRow>
                <columnValue>
                        fourthrow
                </columnValue>
                <columnValue>
                        4
                </columnValue>
        </currentRow>
 </data>
 

2.3 상태 3 - 행의 삽입

WebRowSet 객체는, 삽입행으로 이동해, 행의 각 열에 대해서 적절한 갱신 메소드를 호출해,insertRow 메소드를 호출하는 것에 의해, 새로운 행을 삽입할 수 있습니다.
 wrs.moveToInsertRow();
 wrs.updateString(1, "fifththrow");
 wrs.updateString(2, "5");
 wrs.insertRow();
 
다음의 코드의 발췌에서는, 삽입한지 얼마 안된 행의 2 번째의 값을 변경하고 있습니다. 이 코드는, 현재의 행의 직후에 새로운 행이 삽입되었을 경우에 적용됩니다. 이 때문에,next 메소드로 커서를 올바른 행으로 이동하고 있습니다. acceptChanges 메소드를 호출한다고 변경을 데이터 소스에 기입합니다.
 wrs.moveToCurrentRow();
 wrs.next();
 wrs.updateString(2, "V");
 wrs.acceptChanges();
 :
 
이것을 XML 로 기술해, 어디서, Java 코드에 의해 새로운 행이 삽입되어 각 필드에 새롭게 삽입된 행이 갱신되는지를 나타냅니다.
 <data>
        <currentRow>
                <columnValue>
                        firstrow
                </columnValue>
                <columnValue>
                        1
                </columnValue>
        </currentRow>
        <currentRow>
                <columnValue>
                        secondrow
                </columnValue>
                <columnValue>
                        2
                </columnValue>
        </currentRow>
        <currentRow>
                <columnValue>
                        newthirdrow
                </columnValue>
                <columnValue>
                        III
                </columnValue>
        </currentRow>
        <insertRow>
                <columnValue>
                        fifthrow
                </columnValue>
                <columnValue>
                        5
                </columnValue>
                <updateValue>
                        V
                </updateValue>
        </insertRow>
        <currentRow>
                <columnValue>
                        fourthrow
                </columnValue>
                <columnValue>
                        4
                </columnValue>
        </currentRow>
 </date>
 

2.4 상태 4 - 행의 변경

행을 변경하면(자), 새로운 값과 치환된 값의 양쪽 모두를 기록하는 고유의 XML 가 생성됩니다. 치환된 값은 원의 값이 되어, 새로운 값은 현재의 값이 됩니다. 다음의 코드는, 커서를 특정의 행으로 이동해, 변경을 실시해, 완료하면(자) 행을 갱신합니다.
 wrs.absolute(5);
 wrs.updateString(1, "new4thRow");
 wrs.updateString(2, "IV");
 wrs.updateRow();
 
이 처리는, XML 에서는 modifyRow 태그로 기술됩니다. 원의 행을 추적할 수 있도록(듯이), 태그내에는 원의 값과 새로운 값의 양쪽 모두가 들어갑니다.
 <data>
        <currentRow>
                <columnValue>
                        firstrow
                </columnValue>
                <columnValue>
                        1
                </columnValue>
        </currentRow>
        <currentRow>
                <columnValue>
                        secondrow
                </columnValue>
                <columnValue>
                        2
                </columnValue>
        </currentRow>
        <currentRow>
                <columnValue>
                        newthirdrow
                </columnValue>
                <columnValue>
                        III
                </columnValue>
        </currentRow>
        <currentRow>
                <columnValue>
                        fifthrow
                </columnValue>
                <columnValue>
                        5
                </columnValue>
        </currentRow>
        <modifyRow>
                <columnValue>
                        fourthrow
                </columnValue>
                <updateValue>
                        new4thRow
                </updateValue>
                <columnValue>
                        4
                </columnValue>
                <updateValue>
                        IV
                </updateValue>
        </modifyRow>
 </data>
 

관련 항목:
JdbcRowSet , CachedRowSet , FilteredRowSet , JoinRowSet

필드의 개요
static String PUBLIC_XML_SCHEMA
          XML 태그와 이러한 XML 태그의 WebRowSet 구현에서의 유효치를 정의하는, XML schema 정의의 공개 식별자입니다.
static String SCHEMA_SYSTEM_ID
          XML 태그와 이러한 XML 태그의 WebRowSet 구현에서의 유효치를 정의하는, XML schema 정의의 URL 입니다.
 
인터페이스 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
 
메소드의 개요
 void readXml (InputStream  iStream)
          스트림 베이스의 XML 입력을 읽어들여,WebRowSet 객체를 생성합니다.
 void readXml (Reader  reader)
          지정된 Reader 객체로부터, XML 형식에서 WebRowSet 객체를 읽어냅니다.
 void writeXml (OutputStream  oStream)
          이 WebRowSet 객체의 데이터, 프로퍼티, 메타데이타가 지정된 OutputStream 객체에 XML 형식에서 기입합니다.
 void writeXml (ResultSet  rs, OutputStream  oStream)
          지정된 ResultSet 객체의 컨텐츠로부터 이 WebRowSet 객체를 생성해, 그 데이터, 프로퍼티, 및 메타데이타가 지정된 OutputStream 객체에 XML 형식에서 기입합니다.
 void writeXml (ResultSet  rs, Writer  writer)
          지정된 ResultSet 객체의 컨텐츠로부터 이 WebRowSet 객체를 생성해, 그 데이터, 프로퍼티, 및 메타데이타가 지정된 Writer 객체에 XML 형식에서 기입합니다.
 void writeXml (Writer  writer)
          이 WebRowSet 객체의 데이터, 프로퍼티, 메타데이타가 지정된 Writer 객체에 XML 형식에서 기입합니다.
 
인터페이스 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
 

필드의 상세

PUBLIC_XML_SCHEMA

static final String  PUBLIC_XML_SCHEMA
XML 태그와 이러한 XML 태그의 WebRowSet 구현에서의 유효치를 정의하는, XML schema 정의의 공개 식별자입니다.

관련 항목:
정수 필드치

SCHEMA_SYSTEM_ID

static final String  SCHEMA_SYSTEM_ID
XML 태그와 이러한 XML 태그의 WebRowSet 구현에서의 유효치를 정의하는, XML schema 정의의 URL 입니다.

관련 항목:
정수 필드치
메소드의 상세

readXml

void readXml(Reader  reader)
             throws SQLException 
지정된 Reader 객체로부터, XML 형식에서 WebRowSet 객체를 읽어냅니다.

파라미터:
reader - java.io.Reader 스트림. 여기로부터 WebRowSet 객체가 생성된다
예외:
SQLException - 데이타베이스 액세스 에러가 발생했을 경우

readXml

void readXml(InputStream  iStream)
             throws SQLException ,
                    IOException 
스트림 베이스의 XML 입력을 읽어들여,WebRowSet 객체를 생성합니다.

파라미터:
iStream - java.io.InputStream 스트림. 여기로부터 WebRowSet 객체가 생성된다
예외:
SQLException - 데이터 소스 액세스 에러가 발생했을 경우
IOException - IO 예외가 발생했을 경우

writeXml

void writeXml(ResultSet  rs,
              Writer  writer)
              throws SQLException 
지정된 ResultSet 객체의 컨텐츠로부터 이 WebRowSet 객체를 생성해, 그 데이터, 프로퍼티, 및 메타데이타가 지정된 Writer 객체에 XML 형식에서 기입합니다.  

주:WebRowSet 커서는, XML 데이터 소스에 컨텐츠를 써내기 위해서(때문에) 이동할지도 모릅니다. 이와 같이 구현되고 있는 경우, 커서를,writeXml() 호출의 직전의 위치에 되돌릴 필요가 있습니다.

파라미터:
rs - 이 WebRowSet 객체를 생성한다 ResultSet 객체
writer - 기입처의 java.io.Writer 객체
예외:
SQLException - 행 세트의 컨텐츠를 XML 형식에서 써낼 때 에러가 발생했을 경우

writeXml

void writeXml(ResultSet  rs,
              OutputStream  oStream)
              throws SQLException ,
                     IOException 
지정된 ResultSet 객체의 컨텐츠로부터 이 WebRowSet 객체를 생성해, 그 데이터, 프로퍼티, 및 메타데이타가 지정된 OutputStream 객체에 XML 형식에서 기입합니다.  

주:WebRowSet 커서는, XML 데이터 소스에 컨텐츠를 써내기 위해서(때문에) 이동할지도 모릅니다. 이와 같이 구현되고 있는 경우, 커서를,writeXml() 호출의 직전의 위치에 되돌릴 필요가 있습니다.

파라미터:
rs - 이 WebRowSet 객체를 생성한다 ResultSet 객체
oStream - 기입처의 java.io.OutputStream
예외:
SQLException - 데이터 소스 액세스 에러가 발생했을 경우
IOException - IO 예외가 발생했을 경우

writeXml

void writeXml(Writer  writer)
              throws SQLException 
WebRowSet 객체의 데이터, 프로퍼티, 메타데이타가 지정된 Writer 객체에 XML 형식에서 기입합니다.

파라미터:
writer - 기입처의 java.io.Writer 스트림
예외:
SQLException - 행 세트의 컨텐츠를 XML 에 써낼 때 에러가 발생했을 경우

writeXml

void writeXml(OutputStream  oStream)
              throws SQLException ,
                     IOException 
WebRowSet 객체의 데이터, 프로퍼티, 메타데이타가 지정된 OutputStream 객체에 XML 형식에서 기입합니다.

파라미터:
oStream - 기입처의 java.io.OutputStream 스트림
예외:
SQLException - 데이터 소스 액세스 에러가 발생했을 경우
IOException - IO 예외가 발생했을 경우

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 도 참조해 주세요.