This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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.