类 SqlRowSetResultSetExtractor
- java.lang.Object
- org.springframework.jdbc.core.SqlRowSetResultSetExtractor
- 所有已实现的接口:
ResultSetExtractor<SqlRowSet>
public class SqlRowSetResultSetExtractor extends Object implements ResultSetExtractor<SqlRowSet>
ResultSetExtractor
implementation that returns a SpringSqlRowSet
representation for each givenResultSet
.The default implementation uses a standard JDBC CachedRowSet underneath.
- 从以下版本开始:
- 1.2
- 作者:
- Juergen Hoeller
- 另请参阅:
newCachedRowSet()
,SqlRowSet
,JdbcTemplate.queryForRowSet(String)
,CachedRowSet
构造器概要
构造器 构造器 说明 SqlRowSetResultSetExtractor()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected SqlRowSet
createSqlRowSet(ResultSet rs)
SqlRowSet
extractData(ResultSet rs)
Implementations must implement this method to process the entire ResultSet.protected CachedRowSet
newCachedRowSet()
Create a newCachedRowSet
instance, to be populated by thecreateSqlRowSet
implementation.
构造器详细资料
SqlRowSetResultSetExtractor
public SqlRowSetResultSetExtractor()
方法详细资料
extractData
public SqlRowSet extractData(ResultSet rs) throws SQLException
从接口复制的说明:ResultSetExtractor
Implementations must implement this method to process the entire ResultSet.- 指定者:
extractData
在接口中ResultSetExtractor<SqlRowSet>
- 参数:
rs
- the ResultSet to extract data from. Implementations should not close this: it will be closed by the calling JdbcTemplate.- 返回:
- an arbitrary result object, or
null
if none (the extractor will typically be stateful in the latter case). - 抛出:
SQLException
- if an SQLException is encountered getting column values or navigating (that is, there's no need to catch SQLException)
createSqlRowSet
protected SqlRowSet createSqlRowSet(ResultSet rs) throws SQLException
Create aSqlRowSet
that wraps the givenResultSet
, representing its data in a disconnected fashion.This implementation creates a Spring
ResultSetWrappingSqlRowSet
instance that wraps a standard JDBCCachedRowSet
instance. Can be overridden to use a different implementation.- 参数:
rs
- the original ResultSet (connected)- 返回:
- the disconnected SqlRowSet
- 抛出:
SQLException
- if thrown by JDBC methods- 另请参阅:
newCachedRowSet()
,ResultSetWrappingSqlRowSet
newCachedRowSet
protected CachedRowSet newCachedRowSet() throws SQLException
Create a newCachedRowSet
instance, to be populated by thecreateSqlRowSet
implementation.The default implementation uses JDBC 4.1's
RowSetFactory
.- 返回:
- a new CachedRowSet instance
- 抛出:
SQLException
- if thrown by JDBC methods- 另请参阅:
createSqlRowSet(java.sql.ResultSet)
,RowSetProvider.newFactory()
,RowSetFactory.createCachedRowSet()