类 SqlRowSetResultSetExtractor

    • 方法详细资料

      • extractData

        public SqlRowSet extractData​(ResultSet rs)
                              throws SQLException
        从接口复制的说明: ResultSetExtractor
        Implementations must implement this method to process the entire ResultSet.
        指定者:
        extractData 在接口中 ResultSetExtractor<SqlRowSet>
        参数:
        rs - 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 a 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 a SqlRowSet that wraps the given ResultSet, representing its data in a disconnected fashion.

        This implementation creates a Spring ResultSetWrappingSqlRowSet instance that wraps a standard JDBC CachedRowSet 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 new CachedRowSet instance, to be populated by the 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.

        返回:
        a new CachedRowSet instance
        抛出:
        SQLException - if thrown by JDBC methods
        另请参阅:
        createSqlRowSet(java.sql.ResultSet)