aspose file tools*
The moose likes JDBC and the fly likes SQLException: unable to execute updateString for read only Resultset Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQLException: unable to execute updateString for read only Resultset" Watch "SQLException: unable to execute updateString for read only Resultset" New topic
Author

SQLException: unable to execute updateString for read only Resultset

RaviSingh Kumar
Ranch Hand

Joined: Sep 04, 2007
Posts: 52
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

Joined: Dec 14, 2009
Posts: 72
Can you post the code here.


They say you have to be the first, the best or different. I say, is it too much to ask for all three.
RaviSingh Kumar
Ranch Hand

Joined: Sep 04, 2007
Posts: 52
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

Joined: Dec 14, 2009
Posts: 72
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

Joined: Sep 04, 2007
Posts: 52
Please also let me know how to find that my driver support updateable resultset or not.

Thanks
Sandeep Sanaboyina
Ranch Hand

Joined: Dec 14, 2009
Posts: 72
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQLException: unable to execute updateString for read only Resultset