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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.