Search in sources :

Example 1 with ResultSetWrappingSqlRowSet

use of org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet in project spring-framework by spring-projects.

the class SqlRowSetResultSetExtractor method createSqlRowSet.

/**
	 * Create a SqlRowSet that wraps the given ResultSet,
	 * representing its data in a disconnected fashion.
	 * <p>This implementation creates a Spring ResultSetWrappingSqlRowSet
	 * instance that wraps a standard JDBC CachedRowSet instance.
	 * Can be overridden to use a different implementation.
	 * @param rs the original ResultSet (connected)
	 * @return the disconnected SqlRowSet
	 * @throws SQLException if thrown by JDBC methods
	 * @see #newCachedRowSet
	 * @see org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
	 */
protected SqlRowSet createSqlRowSet(ResultSet rs) throws SQLException {
    CachedRowSet rowSet = newCachedRowSet();
    rowSet.populate(rs);
    return new ResultSetWrappingSqlRowSet(rowSet);
}
Also used : ResultSetWrappingSqlRowSet(org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet) CachedRowSet(javax.sql.rowset.CachedRowSet)

Aggregations

CachedRowSet (javax.sql.rowset.CachedRowSet)1 ResultSetWrappingSqlRowSet (org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet)1