*
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 Android Security Essentials Live Lessons this week in the Android 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: 38033
    
  22
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
 
Similar Threads
SQL Server 2000 Return Value
java.sql.SQLException: Missing IN or OUT parameter at index:: 1
Error on Batch Update using Oracle
The getConnection method is trying to ruin my life!
JSP returning old data, database was changed correctly!