Re: Java problem

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 9 Jan 2003 19:15:18 -0800
Message-ID: <92eeeff0.0301091915.5eb98e34_at_posting.google.com>


salvi_at_gmx.ch (salvi) wrote in message news:<d0e08f90.0301080832.7868f86f_at_posting.google.com>...
> Hello
>
> Installing a java-class on a new system (the same class runs on
> another system without a problem) raises problems. It's a mail-class
> (javax/mail). Whenever I call this class, I get an error back.
> Where can I see the actual java error code on the DB? Is there a table
> entry or a file, where I can read out the thrown exception?

First the assumptions...as you have not provided enough information. You have successfully loaded javax.mail jar file in the database using loadjava utility. You have a java stored procedure that calls something in javax.mail api. You also have a PL/SQL wrapper function that calls your java stored procedure. An Exception is thrown on your call which you want to trap and see.

If above is all true then you have to first trap the Exception in your java stored procedure by using try {} catch or throws Exception,

  1. Use try {} catch and return the Exception message to your PL/SQL function or use System.out.
  2. throws Exception will automatically generate a PL/SQL Exception "Uncaught java Exception". Not much info here.
  3. Use System.out in your java stored procedure and use SET SERVEROUT ON setting before calling your PL/SQL function from Sqlplus.

If above assumption is not true then RTFM on using java stored procedures and loading java classes into the database.

Regards
/Rauf Sarwar Received on Fri Jan 10 2003 - 04:15:18 CET

Original text of this message