public class ResultSetExtractor2SqlRowSet extends Object implements ResultSetExtractor<SqlRowSet>
This implementation creates a Spring ResultSetWrappingSqlRowSet instance that wraps a standard JDBC CachedRowSet instance. Can be overridden to use a different implementation.
@author online.sanen Date:2018年11月10日 Time:下午1:55:00
| 构造器和说明 |
|---|
ResultSetExtractor2SqlRowSet() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected SqlRowSet |
createSqlRowSet(ResultSet rs)
Create a SqlRowSet that wraps the given ResultSet, representing its data in a
disconnected fashion.
|
SqlRowSet |
extractData(ResultSet rs)
Implementations must implement this method to process the entire ResultSet.
|
protected CachedRowSet |
newCachedRowSet()
Create a new CachedRowSet instance, to be populated by the
createSqlRowSet implementation. |
public SqlRowSet extractData(ResultSet rs) throws SQLException
ResultSetExtractorextractData 在接口中 ResultSetExtractor<SqlRowSet>rs - ResultSet to extract data from. Implementations should not close
this: it will be closed by the calling JdbcTemplate.null if none (the extractor
will typically be stateful in the latter case).SQLException - if a SQLException is encountered getting column
values or navigating (that is, there's no need to
catch SQLException)protected SqlRowSet createSqlRowSet(ResultSet rs) throws SQLException
This implementation creates a Spring ResultSetWrappingSqlRowSet instance that wraps a standard JDBC CachedRowSet instance. Can be overridden to use a different implementation.
rs - SQLExceptionprotected CachedRowSet newCachedRowSet() throws SQLException
createSqlRowSet implementation.
The default implementation uses JDBC 4.1's RowSetProvider when running on JDK
7 or higher, falling back to Sun's com.sun.rowset.CachedRowSetImpl
class on older JDKs.
SQLException - if thrown by JDBC methodscreateSqlRowSet(java.sql.ResultSet)Copyright © 2023. All rights reserved.