public interface JdbcRowSet extends RowSet, Joinable
JdbcRowSet所有标准的实现必须实现的标准接口。
ResultSet对象可以用设置为JavaBeans组件的结果™。因此,一个
JdbcRowSet对象可以是一个工具,可以构成一个应用豆。因为
JdbcRowSet是连接行集,即,它不断地保持其数据库采用JDBC技术连接功能的驱动程序,并有效地使司机一个JavaBeans组件。
因为它总是连接到数据库,对JdbcRowSet实例可以采取电话调用它,又叫他们在ResultSet对象。作为结果,结果集可以,例如,在一个秋千应用程序中的一个组件。
一个JdbcRowSet对象的另一个优点是,它可以用来做ResultSet对象滚动和更新。所有的RowSet对象默认滚动和更新。如果驱动程序和数据库正在使用不支持滚动和/或结果集的更新,应用程序可以在一个ResultSet对象的数据JdbcRowSet对象和操作对象的JdbcRowSet仿佛ResultSet对象。
JdbcRowSet对象JdbcRowSet接口,
JdbcRowSetImpl参考实现,提供了默认构造函数的实现。一个新的实例初始化为默认值,它可以根据需要设置新的值。一个新的实例,是不是真的
execute功能直到调用方法。总的来说,这一方法如下:
PreparedStatement对象并设置其任何占位符参数ResultSet对象execute方法是成功的,它将设置适当的私人
JdbcRowSet领域如下:
Connection对象——数据集和数据库之间的连接PreparedStatement对象查询产生的结果集ResultSet对象的结果集的行集的命令产生的是,实际上,一个JavaBeans组件execute方法没有执行成功,没有方法比其他
execute和
close可能呼吁行集。所有其他公共方法将抛出一个异常。
在调用execute方法,然而,建立一个连接必须设置所需要的命令和特性。下面的代码片段创建一个JdbcRowSetImpl对象,设置命令和连接属性,设置参数的占位符,然后调用该方法execute。
jdbcrowsetimpl JRS =新jdbcrowsetimpl();JRS。setcommand(“选择*从游戏类型=?”);JRS。seturl(JDBC:我:myattribute”);当时setusername(“塞万提斯”);当时setpassword(“桑”);JRS。如果(1,“传”);execute() JRS;变
jrs现在代表一个实例,是一个薄
JdbcRowSetImpl包裹含
ResultSet对象表中的
TITLES,书的类型是传记的所有行。在这一点上,操作要求
jrs将影响结果集的行,这是一种有效的JavaBeans组件。
在JdbcRowSet参考实现方法execute RowSet实施不同于在CachedRowSet™参考实现帐户连接的不同要求和断开RowSet对象。
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| Modifier and Type | Method and Description |
|---|---|
void |
commit()
每个
JdbcRowSet包含
Connection对象从
ResultSet或JDBC传递给它的构造函数的特性。
|
boolean |
getAutoCommit()
每个
JdbcRowSet包含
Connection对象从原来的
ResultSet或JDBC传递给它的性质。
|
RowSetWarning |
getRowSetWarnings()
获取第一个警告,呼吁这
JdbcRowSet报道对象。
|
boolean |
getShowDeleted()
检索
boolean指示标记为删除的行出现在当前行设置。
|
void |
rollback()
每个
JdbcRowSet包含
Connection对象从原来的
ResultSet或JDBC传递给它的性质。
|
void |
rollback(Savepoint s)
每个
JdbcRowSet包含
Connection对象从原来的
ResultSet或JDBC传递给它的性质。
|
void |
setAutoCommit(boolean autoCommit)
每个
JdbcRowSet包含
Connection对象从原来的
ResultSet或JDBC传递给它的性质。
|
void |
setShowDeleted(boolean b)
设置为给定值的属性
showDeleted
boolean。
|
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, 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, unsetMatchColumnboolean getShowDeleted()
throws SQLException
boolean指示标记为删除的行出现在当前行设置。如果
true返回,删除行与当前可见行。如果
false返回当前行,行集是不可见的。默认值是
false。
标准数据集的实现可能选择出于安全考虑或某些部署场景限制这种行为。已删除的行的可见性是实现定义的,不代表标准的行为。
注:允许删除的行保持可见的复杂的一些标准的JDBC RowSet实现方法的行为。然而,大多数的行集,用户可以简单地忽略这额外的细节,因为只有非常专业的应用程序可能会想利用这一特点。
true如果删除的行是可见的;
false否则
SQLException -如果一个行集的实现是无法确定是否标记为删除的行仍然可见
setShowDeleted(boolean)
void setShowDeleted(boolean b)
throws SQLException
showDeleted
boolean。此属性确定是否标记为删除的行是否继续出现在当前行集的集合中。如果该值设置为
true,删除行立即可见,当前行集。如果该值设置为
false,被删除的行设置为不可见行的当前设置。
标准数据集的实现可能选择出于安全考虑或某些部署场景限制这种行为。这是左作为实现定义的,不代表标准的行为。
b -
true如果删除的行应该显示;
false否则
SQLException -如果一个行集的实现是无法重置已删除的行是否应该是可见的
getShowDeleted()
RowSetWarning getRowSetWarnings() throws SQLException
JdbcRowSet报道对象。如果另一个警告是报道这
JdbcRowSet对象,它将被第一次警告,可以在第一次警告称
RowSetWarning.getNextWarning检索方法。在这
JdbcRowSet对象随后的警告将被锁在
RowSetWarning对象的方法
RowSetWarning.getNextWarning返回。警示链是自动清除,每一次新的行读。这种方法可能不能称之为一
RowSet对象已经关闭;这样做将导致
SQLException被。
因为它总是连接到数据源,一个JdbcRowSet对象可以依靠主动Statement,Connection的存在,和ResultSet实例。这意味着应用程序可以通过调用getNextWarning方法,他们提供获得额外的SQLWarning通知。断开Rowset对象,如CachedRowSet对象,没有获得这些getNextWarning方法。
RowSetWarning对象上报道了这一
JdbcRowSet对象或
null如果没有
SQLException -如果调用此方法在一个封闭的
JdbcRowSet对象
RowSetWarning
void commit()
throws SQLException
JdbcRowSet包含
Connection对象从
ResultSet或JDBC传递给它的构造函数的特性。该方法将
Connection提交方法允许灵活的自动提交或非自动提交事务控制支持。
使所有的更改,因为以前的提交/回滚永久性,并释放当前这个连接对象所持有的任何数据库锁。此方法应仅在自动提交模式已禁用时使用。
SQLException -如果一个数据库访问错误发生或在这
JdbcRowSet对象连接在自动提交模式
Connection.setAutoCommit(boolean)
boolean getAutoCommit()
throws SQLException
JdbcRowSet包含
Connection对象从原来的
ResultSet或JDBC传递给它的性质。该方法将
Connection的
getAutoCommit方法允许应用程序确定的
JdbcRowSet交易行为。
将此连接的自动提交模式设置为给定的状态。如果一个连接是在自动提交模式,然后所有的SQL语句将被执行,致力于为个人交易。否则,它的SQL语句是分为被调用的方法提交或回滚终止交易的方法。默认情况下,新的连接在自动提交模式中。
true如果自动提交功能;
false否则
SQLException -如果一个数据库访问错误发生
Connection.getAutoCommit()
void setAutoCommit(boolean autoCommit)
throws SQLException
JdbcRowSet包含
Connection对象从原来的
ResultSet或JDBC传递给它的性质。该方法将
Connection的
getAutoCommit方法允许应用程序设置
JdbcRowSet交易行为。
设置当前的自动提交这Connection对象模式。
autoCommit -
true启用自动提交;
false禁用自动提交
SQLException -如果一个数据库访问错误发生
Connection.setAutoCommit(boolean)
void rollback()
throws SQLException
JdbcRowSet包含
Connection对象从原来的
ResultSet或JDBC传递给它的性质。撤消所有更改在当前事务并释放任何数据库锁的
Connection对象目前持有。此方法应仅在自动提交模式已禁用时使用。
SQLException -如果一个数据库访问错误发生或在这
JdbcRowSet这
Connection对象是在自动提交模式。
rollback(Savepoint)
void rollback(Savepoint s) throws SQLException
JdbcRowSet包含
Connection对象从原来的
ResultSet或JDBC传递给它的性质。撤消所有更改在当前事务的最后设置保存点和释放任何锁的数据库对象
Connection目前持有。此方法应仅在自动提交模式已禁用时使用。
s -
Savepoint回滚到
SQLException -如果一个数据库访问错误发生或在这
JdbcRowSet对象
Connection在自动提交模式。
rollback()
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.