A Java external procedure can raise a java.lang.SQLException code with an exception number and message that are returned to the database and used to set the SQLSTATE and error message. Java exceptions thrown during the execution of a Java external procedure using SQL are often handled within Java. When this occurs, the exceptions do not affect SQL processing. Only those Java exceptions that are not handled within Java are seen in the SQL environment as SQL exception conditions.
When this occurs, the procedure returns an exception number and message to the Teradata Database which the system then uses to set the SQLSTATE value and error message that it returns to the requestor.
The range for valid SQLSTATE SQLException codes is 38U00 - 38U99, inclusive.
Some predefined error cases, such as non-valid JAR name, that have specific codes defined by the ANSI SQL standard, are also supported. The Teradata implementation of Java external procedures follows those definitions. For more information, see Teradata Vantage™ SQL External Routine Programming , B035-1147 and Teradata Vantage™ SQL Stored Procedures and Embedded SQL , B035-1148 .