File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
 
Consider Paul's rocket mass heater.
 
subject: Multiple updateXXX calls in sequence for multiple rows.
 
Similar Threads
How to get the number of rows in a ResultSet
String to CLOB conversion
Oracle 9i :trouble using setnull(...) in a PreparedStatement
JDBCExceptionReport and Hibernate
java.sql.SQLException: ORA-01733: virtual column not allowed here