Solved

Handling Java Exceptions from PL/SQL Code

Posted on 2006-10-30
4
1,211 Views
Last Modified: 2013-12-11
I loaded a Java class into the DB, and wrapped it with a pl\sql package.

I would like to know if there is a way to catch exceptions thrown by the Java class and handle them in the pl\sql package?

Thanks,
Yoni.
0
Comment
Question by:ElishaMoshe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 7

Expert Comment

by:Daniel Stanley
ID: 17840347
DECLARE
     exc ora_java.jobject;
     . . .
  BEGIN
     [ do some operations ]
  EXCEPTION
     WHEN ORA_JAVA.EXCEPTION_THROWN THEN
        exc := ORA_JAVA.LAST_EXCEPTION;
        MESSAGE(Exception_.getMessage(exc));
        ORA_JAVA.CLEAR_EXCEPTION;
  END;

found this, hope this helps.

daniels
0
 

Author Comment

by:ElishaMoshe
ID: 17856258
Hi daniels,

I checked out your suggestion, but it only works in Forms & Reports 9i, not in PL\SQL.

Instead, I found this:
http://www.unix.org.ua/orelly/oracle/guide8i/ch09_08.htm

under:
"9.8.5 Exception Handling with Java".
This looks like it could be useful, even if it is not the most elegant solution...

0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 18066058
PAQed with points refunded (125)

Computer101
EE Admin
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
Via a live example, show how to take different types of Oracle backups using RMAN.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question