Details About the Function of Java External Procedures
When you write the code for an external procedure definition, you indicate that its language is Java by specifying LANGUAGE JAVA in the mandatory LANGUAGE clause (see “LANGUAGE Clause” on page 429).
Java external procedures execute SQL code using the standard JDBC driver interface. Because the Java external procedure is running on the Teradata Database and is invoked from within a logged on session, its connection to the database is by means of a default connection named jdbc:default:connection.
Note that a Java program can create a separate connection to another database, or to the same database (by means of another session to be logged onto). If an external Java procedure does this, its actions can create an undetectable deadlock.
The ANSI SQL:2011 standard specifies the following set of rules for a Java external procedure.
The external Java language routine must be written using the JDBC standard for coding embedded SQL statements in a Java program.
The resulting class or classes (the byte code) must be placed in a JAR file.
Once it has been created, you can access the Java routine in the same manner as any external procedure.
See SQL External Routine Programming for information on writing Java external procedures.