Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQLException: unable to execute updateString for read only Resultset

 
RaviSingh Kumar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to just update database using resultset. When i m trying to do that , getting error as resultset is read only.

I have made resultset as concur_updateable and scroll-sensitive. But still getting the same error.

Please provide some inputs. Thanks in advance
 
Sandeep Sanaboyina
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the code here.
 
RaviSingh Kumar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Below is the code snippet

ResultSet rs = stmt.executeQuery("select * from employees");
rs.absolute(104);
rs.updateString(2,"Test");
rs.updateRow();
 
Sandeep Sanaboyina
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using specific column names instead of *



instead of



It should work. Guess your driver doesn't support an updatable resultset.
 
RaviSingh Kumar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please also let me know how to find that my driver support updateable resultset or not.

Thanks
 
Sandeep Sanaboyina
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know of any way of finding this out.

I you need to use * you can try this work around.



You can refer to this link for further info. Let me know if it works.

search for 'Result Set Limitations and Downgrade Rules' in http://download.oracle.com/docs/cd/B10501_01/java.920/a96654/resltset.htm#1018134

Regards.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic