When I invoke following rows:
Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
ResultSet resultSet =
When you are using, ResultSet.CONCUR_READ_ONLY
, you are getting an exception, that
com.mysql.jdbc.NotUpdatable: Result Set not updatable.This result set must come from a statement that was created with a result set type of ResultSet.CONCUR_UPDATABLE, the query must select only one table, can not use functions and must select all primary keys from that table. See the JDBC 2.1 API Specification, section 5.6 for more details.\
So, changing ResultSet.CONCUR_READ_ONLY
to ResultSet.CONCUR_UPDATABLE
, solved your problem. Correct?
Now, as I understand, you don't want to do that. Am I right? If yes, then I think you are confusing ResultSet with Database,
The method, resultSet.refreshRow()
, suppose to update the resultSet
, hence it rightly requires updatable ResultSet
. I hope it's clear now.