how to identify wather execution of updatequery made changes or not in oracle database
I am using oracle as backhand and jsp servlet as frunthand I am executing update query and I want to identify whether update query has made开发者_如何学C updation in database or not. i am using executeUpdate() it is executing but it results 0 when update query fails to execute and 1 when execution is done but it does not identify whether data is updated or not
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.
精彩评论