File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

verifying update in pl/sql

 
Padmanabh Sahasrabudhe
Ranch Hand
Posts: 53
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic