I'm a bit confused about the following answer:
"A JdbcRowSet object can be used to make a ResultSet object scrollable and updatable."
Based on this statement I would conclude that I have a ResultSet object and that I wrap it into a JdbcRowSet by using the JdbcRowSetImpl(ResultSet) constructor. However you cannot make a ResultSet scrollable or updateable by using this constructor,
see http://docs.oracle.com/javase/tutorial/ ... owset.html
I even tried this out, and got an Exception, as expected:"A JdbcRowSet object created with a ResultSet object serves as a wrapper for the ResultSet object. Because the RowSet object rs is scrollable and updatable, jdbcRs is also scrollable and updatable. If you have run the method createStatement without any arguments, rs would not be scrollable or updatable, and neither would jdbcRs."
Code: Select all
[java] java.sql.SQLException: ResultSet is not updatable
[java] at com.sun.rowset.JdbcRowSetImpl.checkTypeConcurrency(JdbcRowSetImpl.java:4155)
[java] at com.sun.rowset.JdbcRowSetImpl.updateFloat(JdbcRowSetImpl.java:2366)
[java] at com.sun.rowset.JdbcRowSetImpl.updateFloat(JdbcRowSetImpl.java:2779)
[java] at com.oracle.tutorial.jdbc.JdbcRowSetSample.testJdbcRowSet(JdbcRowSetSample.java:101)
[java] at com.oracle.tutorial.jdbc.JdbcRowSetSample.main(JdbcRowSetSample.java:179)
Could someone please be so kind to explain to me what I'm missing here?"Another advantage of a JdbcRowSet object is that it can be used to make a ResultSet object scrollable and updatable. All RowSet objects are by default scrollable and updatable. If the driver and database being used do not support scrolling and/or updating of result sets, an application can populate a JdbcRowSet object with the data of a ResultSet object and then operate on the JdbcRowSet object as if it were the ResultSet object."
Best regards