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