• Post Reply Bookmark Topic Watch Topic
  • New Topic

Updating a ResultSet object..

 
rajesh madhira
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
The following piece of code prints out a "YES" on the console but when i try to update the ResultSet object rs, i get an Exception saying


YES"java.sql.SQLException: Invalid operation for read only resultset : updateBoolean at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.driver.BaseResultSet.updateBoolean(BaseResultSet.java:305)
at org.apache.commons.dbcp.DelegatingResultSet.updateBoolean(DelegatingResultSet.java:373)"

The code follows:

conn = querySession.getConnection();
DatabaseMetaData dmd = conn.getMetaData();
if(dmd.supportsResultSetConcurrency(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_UPDATABLE))
System.out.print("YES");
preparedStatement=conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_UPDATABLE);
ResultSet rs = preparedStatement.executeQuery(query);


can somebody help me out....??

Rajesh Madhira
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!