hello friends i am using oracle as backhand and jsp servlet as frunthand i am executing update query and i want to identify wather update query has made updation in database or not. i am using executeUpdate() it is executing but it results 0 when update query fail to execute and 1 when execution is done but it does not identify wather data is updated or not
views:
14answers:
1
A:
executeUpdate will return the number of modified rows on your update sentence. So if you are getting 0, it does not mean it failed to execute but no rows were modified upon execution. And if you are getting 1, you've managed to update one row.
Usually, if update sentence failed, you will get a SQLException thrown by the JDBC driver.
Pablo Santa Cruz
2010-03-26 14:15:40
i got the point but how can i identify wather updation has made or not?
Deven
2010-03-26 14:41:31
If return value is **n**, then **n** updates were made.
Pablo Santa Cruz
2010-03-26 16:50:18
Still having problem the actual problem is my update query change only on row in my database but if i execute first time it results 1 and if i execute it same query 2nd time still it answers 1 while record is not updated, and if i execute same moer still it shows 1 as answer
Deven
2010-03-29 04:18:52