JdbcRowSetImpl
is a - relatively - thin wrapper around a Resultset
, so it demands that the ResultSet
is also scrollable to be able to provide the required scrollability, if you don't want to or can't provide a scrollable result set you can use a CachedRowSet
.
Contrary to what the tutorial you link to says, the com.sun.rowset.JdbcRowSetImpl
does not convert a non-scrollable ResultSet
to a scrollable result set. The implementation simply wraps the ResultSet
and forwards calls directly to it, so if the ResultSet
is not scrollable then the JdbcRowSet
isn't either. Same goes for the updatability.
The tutorial seems to be contradictory, because after the introduction that you can use JdbcRowSet
to make a result set scrollable, it notes:
A
JdbcRowSet
object created with aResultSet
object serves as a wrapper for theResultSet
object. Because theRowSet
object rs is scrollable and updatable,jdbcRs
is also scrollable and updatable. If you have run the methodcreateStatement
without any arguments,rs
would not be scrollable or updatable, and neither wouldjdbcRs
.
(emphasis mine)