wood burning stoves 2.0*
The moose likes JDBC and the fly likes Multiple updateXXX calls in sequence for multiple rows. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Multiple updateXXX calls in sequence for multiple rows." Watch "Multiple updateXXX calls in sequence for multiple rows." New topic
Author

Multiple updateXXX calls in sequence for multiple rows.

sajeev varghese
Greenhorn

Joined: Jan 27, 2006
Posts: 14
Hi ,

When i try to retrieve & update rows obtain through Updateble Result Date.I am getting the following Exception.

java.sql.SQLException: Value conflicts occurs
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:211)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:274)
at oracle.jdbc.driver.UpdatableResultSet.execute_updateRow(UpdatableResultSet.java:2136)
at oracle.jdbc.driver.UpdatableResultSet.updateRow(UpdatableResultSet.java:1322)
at weblogic.jdbc.wrapper.ResultSet_oracle_jdbc_driver_UpdatableResultSet.updateRow(Unknown Source)
at de.cc_gmbh.ps.common.AutoPDFDownloadListener.run(AutoPDFDownloadListener.java:237)
at java.lang.Thread.run(Thread.java:536)

Code:
PreparedStatement preStmt = null;
ResultSet result = null;
preStmt = dbCon.prepareStatement(query,ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
preStmt.setString(1, "QUEUE");
result = preStmt.executeQuery();
while (result.next())
{
//retrieve data //destination = result.getString(1);
//Processing those

result.updateString("STATUS", BTConstants.STATUS_COMPLETE);
result.updateString("FILENAME", fileName);
result.updateRow();
}

Rgds
Sajeev
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple updateXXX calls in sequence for multiple rows.