Solved

Handling Java Exceptions from PL/SQL Code

Posted on 2006-10-30
4
1,138 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
Comment Utility
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
Comment Utility
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
Comment Utility
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.

Join & Write a Comment

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to take different types of Oracle backups using RMAN.

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now