Hi,
I am trying to run some simple updates using java in Oracle(10g). I have a simple java program to do it. Running the code using Eclipse IDE.
The strange thing about it is that the connection is fine. If I run a select query, it works fine. However if I run an update query, it just doesn't do anything. It just gets stuck on the executeUpdate line.(No error message, it just sits there forever)
thought it may have something to do with the connection type, so tried it with thin driver as well as the data source. Both ways its the same.
Ran the query manually, and it works fine.The issue is that I have to run the same query for over 14000 objects, so I desperately need this program to work.
tried it with statement, preparedStatement, and almost every possible way but it gets stuck at the same place. The select works fine, the update will not do anything.

below is the code snippet ..

int updateQuery = 0;
.............
............
Connection conn = DriverManager.getConnection(url,"MyuserId","Mypassword");
conn.setAutoCommit(true);
Statement stmt = conn.createStatement();
System.out.println("Executing the query");
updateQuery = stmt.executeUpdate("update der_document_s set staus = 'processed' where id = '08464464'");
System.out.println("Query executed");
..........
..........

will be greatful if you can provide some help on it.
Thanks in advance
Ravi

Edited 6 Years Ago by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)

I don't see anything wrong with what you have there. Have you tried running it through a PreparedStatement?

I don't see anything wrong with what you have there. Have you tried running it through a PreparedStatement?

Yes, I did... and it didn't help.... unable to figure out what is creating the problem.

This article has been dead for over six months. Start a new discussion instead.