This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Updating a ResultSet object.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Updating a ResultSet object.." Watch "Updating a ResultSet object.." New topic
Author

Updating a ResultSet object..

rajesh madhira
Greenhorn

Joined: Apr 09, 2007
Posts: 3
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Updating a ResultSet object..
 
Similar Threads
rs.updateInt() not working. . please help
Getting array of Oracle Objects
Multiple updateXXX calls in sequence for multiple rows.
ClassNotFoundException
Exhausted Resultset Exception