wood burning stoves*
The moose likes JDBC and the fly likes Raise an Exception in PL/SQL but not got @ JAVA End Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Raise an Exception in PL/SQL but not got @ JAVA End" Watch "Raise an Exception in PL/SQL but not got @ JAVA End" New topic
Author

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

Shaan Shar
Ranch Hand

Joined: Dec 27, 2005
Posts: 1249

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.......


The Best way to predict your future is to create it - Every great individual common man
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30758
    
156

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Raise an Exception in PL/SQL but not got @ JAVA End