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 Android Security Essentials Live Lessons this week in the Android 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

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************
p_status := Pkg_PalletHosp.cons_error;
*********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
internet detective

Joined: May 26, 2003
Posts: 30138

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
I agree. Here's the link: http://aspose.com/file-tools
subject: Raise an Exception in PL/SQL but not got @ JAVA End
Similar Threads
Raise an Exception from One StoredProcedure to another
User Defined SQLException...
Copying VARCHAR2 Data type to a Java Host Variable of String type in embedded SQL
How to capture the exception in oracle trigger from Java client?
User Defined SQLException...