Solved

Handling Java Exceptions from PL/SQL Code

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Developer 6 75
Oracle function to insert records? 15 62
SQL Workhours Count beetween Workhours 3 39
date show only hh:mm 2 37
Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
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.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

740 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