This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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 and Relational Databases
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
 
Have you checked out Aspose?
 
subject: Multiple updateXXX calls in sequence for multiple rows.
 
It's not a secret anymore!