public interface WebRowSet extends CachedRowSet
WebRowSet实现必须实现的标准接口。
WebRowSetImpl提供标准的参考实现,如果需要,可以延长。
标准的WebRowSet XML架构定义可在以下URI:
说明了标准的XML文档格式的要求时,RowSet对象描述XML和必须使用所有标准的实现
WebRowSet接口来确保互操作性。此外,该
WebRowSet架构使用特定SQL / XML注释,从而确保更大的跨平台的互操作性。这是一个正在进行的努力在国际组织组织。SQL / XML定义可在以下URI:
模式定义了一个
RowSet对象的内部数据在三个不同的区域:
RowSet性质。WebRowSet对象关联的元数据表格结构。元数据描述了可在底层java.sql.ResultSet界面元数据紧密排列。WebRowSet对象上同步数据和当前数据的状态)。通过跟踪原始数据和当前数据之间的三角洲,一个WebRowSet保持同步的数据更改回原始数据源的能力。WebRowSet实现应该使用XML Schema描述更新、插入和删除操作和描述XML中的一
WebRowSet对象的状态。
WebRowSet对象到XMLWebRowSet对象创建和填充一个简单的2列,5行的表的数据源。有一
WebRowSet对象的5行可以在XML描述。描述的各种标准JavaBeans属性作为行集界面加在
CachedRowSet™接口定义的标准特性提供了关键的细节描述WebRowSet属性中定义的元数据。XML输出WebRowSet对象使用标准的
writeXml方法描述的内部特性如下:
<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>Oracle Corporation</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标签可能包含的
stringData或
binaryData标签,根据XML值映射到SQL类型。的
binaryData标签包含Base64编码数据,通常用于
BLOB和
CLOB型数据。
<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>
WebRowSet对象中删除一行只需移动到要删除的行,然后调用方法
deleteRow,在任何其他
RowSet对象。下面的两行代码,这是一个
WebRowSet WRS对象,删除第三行。
WRS。绝对(3);deleterow() WRS;XML描述显示第三行标记为
deleteRow,从而消除了在
WebRowSet对象第三排。
<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>
WebRowSet对象可以移动到插入行,插入新的一行,调用相应的更新方法,行中的每列,然后调用方法
insertRow。
wrs.moveToInsertRow();
wrs.updateString(1, "fifththrow");
wrs.updateString(2, "5");
wrs.insertRow();
下面的代码片段的变化,第二列值在刚插入的行。请注意,此代码适用于新的行插入在当前行,这也是为什么方法
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>
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
| Modifier and Type | Field and Description |
|---|---|
static String |
PUBLIC_XML_SCHEMA
公共的XML架构定义,定义了XML的标记和一个
WebRowSet实施有效值的标识符。
|
static String |
SCHEMA_SYSTEM_ID
对于XML架构定义文件定义了XML的标记和一个
WebRowSet实施有效值的URL。
|
COMMIT_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 |
|---|---|
void |
readXml(InputStream iStream)
一种基于XML的输入来填充这
WebRowSet对象流中读取。
|
void |
readXml(Reader reader)
读一
WebRowSet对象的XML格式从给定的
Reader对象。
|
void |
writeXml(OutputStream oStream)
写入数据,属性,和这
WebRowSet对象到给定的XML格式的
OutputStream对象元数据。
|
void |
writeXml(ResultSet rs, OutputStream oStream)
这
WebRowSet填充对象与给定的
ResultSet对象的内容和写数据,性能,和元数据的XML格式的
OutputStream对象。
|
void |
writeXml(ResultSet rs, Writer writer)
这
WebRowSet填充对象与给定的
ResultSet对象的内容和写数据,性能,和元数据的XML格式的
Writer对象。
|
void |
writeXml(Writer writer)
写入数据,属性,和这
WebRowSet对象到给定的XML格式的
Writer对象元数据。
|
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, 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, unsetMatchColumnstatic final String PUBLIC_XML_SCHEMA
WebRowSet实施有效值的标识符。
static final String SCHEMA_SYSTEM_ID
WebRowSet实施有效值的URL。
void readXml(Reader reader) throws SQLException
Reader对象的XML格式的
WebRowSet对象。
reader -
java.io.Reader流从这
WebRowSet对象将被填充
SQLException -如果一个数据库访问错误发生
void readXml(InputStream iStream) throws SQLException, IOException
WebRowSet对象流中读取。
iStream -
java.io.InputStream这
WebRowSet对象将被填充
SQLException如果数据源访问错误发生
IOException -如果发生IO异常
void writeXml(ResultSet rs, Writer writer) throws SQLException
WebRowSet填充对象与给定的
ResultSet对象的内容和写数据,性能,和元数据的XML格式的
Writer对象。
注:本WebRowSet光标移动可能写出内容的XML数据源。如果以这种方式实现的,光标必须只是向writeXml()呼叫之前回到它的位置。
rs -
ResultSet对象以填充这个
WebRowSet对象
writer -写的
java.io.Writer对象。
SQLException -如果出现错误,写出来的内容的XML格式的数据集
void writeXml(ResultSet rs, OutputStream oStream) throws SQLException, IOException
WebRowSet填充对象与给定的
ResultSet对象的内容和写数据,性能,和元数据的XML格式的
OutputStream对象。
注:本WebRowSet光标移动可能写出内容的XML数据源。如果以这种方式实现的,光标必须只是向writeXml()呼叫之前回到它的位置。
rs -
ResultSet对象以填充这个
WebRowSet对象
oStream -
java.io.OutputStream写
SQLException如果数据源访问错误发生
IOException如果发生IO异常
void writeXml(Writer writer) throws SQLException
WebRowSet对象到给定的XML格式的
Writer对象元数据。
writer -
java.io.Writer流写
SQLException -如果出现错误写行集内容的XML
void writeXml(OutputStream oStream) throws SQLException, IOException
WebRowSet对象到给定的XML格式的
OutputStream对象元数据。
oStream -
java.io.OutputStream流写
SQLException如果数据源访问错误发生
IOException如果发生IO异常
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.