"nkarthi123",
Welcome to the JavaRanch. We don't have many rules here at the JavaRanch, but we do insist that you use you Real Name and not some sort of "handle" or obvious alias. If you're not sure about this, see
http://www.javaranch.com/name.jsp .
Stored Procedures are a very useful and powerful thing, but all too often they're abused. I've got an app right now that has to run on 2 different OS's because the database part is all done in Microsoft SQL Server stored procedures. Microsoft doesn't do SQL Server for Linux, I can't keep the database on the Linux box - I have to keep a second machine running Windows just for the database. Converting the stored procedures so I could use an OS-agnostic DBMS like MySQL or Oracle would be cost-prohibitive.
On top of that, the program is a
<censored> to maintain. About half the program logic isn't even
in the program - it's in the database.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.