Compiling the Source Code | Java UDFs | Teradata Vantage - 17.10 - Compiling the Source Code - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1147-171K
Language
English (United States)

To compile the source code for your Java routine, you need javFnc.jar, the Teradata Java external stored procedure and UDF runtime library.

IF you compile the source code on ... THEN ...
your client system download the runtime library from Teradata Downloads.
the database system the runtime library is already available.

Add the path to the runtime library to your class path (or use the -classpath option of the Java compiler). For details on the location of the runtime library on a database system, see Class Path.

For example, suppose you downloaded javFnc.jar to C:\java_udf on your Windows client. You can compile the source code in UDFExample.java as follows:

javac -classpath C:\java_udf\javFnc.jar UDFExample.java

The version of the class file that you generate when you compile the Java source code must be compatible with the JRE on the database system.

For example, suppose the database uses JRE 1.8 and your client system uses JDK 8.0. To compile the source code in UDFExample.java on your client system, you can use the -target option of the Java compiler.

javac -target 1.8 -classpath C:\java_udf\javFnc.jar UDFExample.java

To determine the version of the JRE on the database system, use the cufconfig utility to see where the JRE was installed. For more information, see Teradata Vantageā„¢ - Database Utilities, B035-1102.