This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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

JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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
author & internet detective

Joined: May 26, 2003
Posts: 32481

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.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Raise an Exception in PL/SQL but not got @ JAVA End
It's not a secret anymore!