This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception handling for stored procedure from Java code

 
lakshman kumaran
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do you handle exception while writing stored procedure or accessing stored procedure from java
 
Martin Vajsar
Sheriff
Pie
Posts: 3747
62
Chrome Netbeans IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Handling the exception inside a stored procedure is obviously database specific; you'll probably find the details on your database documentation.

If there is an exception that escapes the stored procedure, it causes an SQLException to be thrown. Again, the details of how this exception is initialized are database specific, but sometimes it is possible to extract useful information from that. For example, in Oracle the SQLException message contains a stack-trace from the PL/SQL code.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic