wood burning stoves
The moose likes Oracle/OAS and the fly likes verifying update in pl/sql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "verifying update in pl/sql" Watch "verifying update in pl/sql" New topic

verifying update in pl/sql

Padmanabh Sahasrabudhe
Ranch Hand

Joined: Mar 04, 2008
Posts: 53
Hi All,

I am running an updated statement thru' the procedure, which is being called from Java. What way can I ensure that the rows are updated?

As I am calling the CallableStatement I have the getUpdateCount method, but this returns something else than what I was looking for.

Here is the code:

I get ConfigurationNotFoundException thrown even if there is proper update. What method should I use to verify if any rows are updated?

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46375
Read the API documentation for Statement#execute(java.lang.String) and see what it returns. Then go to getUpdateCount and see what it returns.
Hemavathy Ramamoorthy Gopal

Joined: May 13, 2008
Posts: 17

getUpdateCount() ---- used to retrieves the current result as an update count; if the result is a ResultSet object or there are no more results, -1 is returned.

Since procedure is used it will result in -1 so it is throwing expection even if updation is happening correclty, to avoid this exception inside procedure you try to return some value greater than according to your validation if the updation goes fine.

I agree. Here's the link: http://aspose.com/file-tools
subject: verifying update in pl/sql
It's not a secret anymore!