Solved

Handling Java Exceptions from PL/SQL Code

Posted on 2006-10-30
4
1,174 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

825 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