Skip to Main Content

Java and JavaScript in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cannot see a thrown Exception from Java Stored Procedure (function)

108225Jan 22 2003 — edited Jan 23 2003
Hi,

When I throw an Exception in my Java Stored Procedure (function), I do not see the error message. I am running this in SQL/Plus. I know that the Exception is being thrown because I exit on an Exception, and I am seeing the exit threw SQL/Plus. Here is a code snippet. Any ideas why I'm not seeing the Exception or the stack trace?
    public static oracle.sql.CLOB to_smt(oracle.sql.CLOB sqlText) {
        CLOB newClob = null;
        try {
            newClob = CLOB.createTemporary(conn, false, CLOB.DURATION_CALL);                    
            String sqlStatementIn = sqlText.getSubString(1, (int)sqlText.length());
            tokenSqlStatement = new StringTokenizer(sqlStatementIn," ;()=<>,",true);
            processTokenSqlStatement();
            newClob.putString(1,sqlStatementOut);
            throw new SQLException("Where or where did the Exception go...");            
        }
        catch (SQLException s) {
            System.err.println("Java Exception caught, error message="+s.getMessage());            
            s.printStackTrace();
            System.exit(3);            
        }        
        catch (Exception e) {
            System.err.println("Java Exception caught, error message="+e.getMessage());            
            e.printStackTrace();
            System.exit(4);            
        }        
            return(newClob);
    }
Here is the output from SQL*PLus:
SQL> select to_smt(sql_text) from clt_sql_text;
ERROR:
ORA-29515: exit called from Java code with status 3
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 20 2003
Added on Jan 22 2003
2 comments
955 views