Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Raise an Exception in PL/SQL but not got @ JAVA End

 
Shaan Shar
Ranch Hand
Posts: 1249
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I have raised an exception in PL/SQL Stored Procedures which is of catagory "WHEN OTHERS THEN" Now here I wrote "RAISE" as the last statement. I was calling this SP from JAVA but when I ran this program, I found that at Oracle side the exception was raised, I mean excution went in exception block but neverthless I haven't received that exception as a SQLException in JAVA.

It's strange behaviour for me, Could anyone help me out. I am attaching the code snippet here below...
*********SQL Stored Procedure************
WHEN OTHERS THEN
p_status := Pkg_PalletHosp.cons_error;
RAISE;
*********SQL Stored Procedure************

And java snippet is as follows:

********JAVA Snippet**************

********JAVA Snippet**************

But execution is not passing through Catch Block.......
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34837
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankur,
It looks like a different exception is being thrown. Your best bet would to be to catch (and output) that so we have more information about what is going on.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic