aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "verifying update in pl/sql" Watch "verifying update in pl/sql" New topic
Author

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?

Thanks,
Padmanabh
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39393
    
  28
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
Greenhorn

Joined: May 13, 2008
Posts: 17
Hi,

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.


Regards,
Hema_RG
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: verifying update in pl/sql