Note that there are some explanatory texts on larger screens.

plurals
  1. PORowSet is not write enabled
    primarykey
    data
    text
    <p>Please help me out, I am trying to update the value of one column in a rowset but I am continously getting an exception..that rowset is not write enabled. I searched a lot but didn't find a way to make the rowset write enabled. Mentioning below the code that I am using and the following exception:</p> <pre><code>Class.forName("oracle.jdbc.driver.OracleDriver"); Connection conn = DriverManager.getConnection( "jdbc:oracle:thin:@localhost:1521:orcl", uname, pwd); String query = "select * from " + table; PreparedStatement preparedStatement = conn.prepareStatement(query); ResultSet rset = preparedStatement.executeQuery(); OracleCachedRowSet oracleCachedRowSet = new OracleCachedRowSet(); oracleCachedRowSet.populate(rset); ResultSetMetaData resultSetMetaData = oracleCachedRowSet.getMetaData(); int numberOfColumns = resultSetMetaData.getColumnCount(); while (oracleCachedRowSet.next()) { oracleCachedRowSet.updateBigDecimal(1, new BigDecimal(99)); oracleCachedRowSet.updateRow(); oracleCachedRowSet.acceptChanges(); for (int i = 1; i &lt;= numberOfColumns; i++) { System.out.print(oracleCachedRowSet.getString(i) + " "); } } } </code></pre> <p>Exception coming on executing the above code :</p> <pre><code>java.sql.SQLException: The RowSet is not write enabled at oracle.jdbc.rowset.OracleCachedRowSet.checkColumnIndex(OracleCachedRowSet.java:912) at oracle.jdbc.rowset.OracleCachedRowSet.updateObject(OracleCachedRowSet.java:5931) at oracle.jdbc.rowset.OracleCachedRowSet.updateBigDecimal(OracleCachedRowSet.java:6430) at Test.getDBConnection(Test.java:86) at Test.main(Test.java:37) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload