Registering the JAR or ZIP File | Java UDFs | Teradata Vantage - Registering the JAR or ZIP File - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
rin1593638965306.ditamap
dita:ditavalPath
rin1593638965306.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantageā„¢

After you write and test the Java source code for a UDF, you place the resulting class or classes in an archive (JAR or ZIP) file.

Next, you call the SQLJ.INSTALL_JAR external stored procedure to register the archive file and its classes with the database, specifying an SQL identifier for the archive file.

If your source code is on a client system, the SQL identifier that you specify is the same name that you use later in the EXTERNAL NAME clause of the CREATE FUNCTION or REPLACE FUNCTION statement to define the SQL function.

For example, consider a JAR file called reports.jar on a Windows client in the directory C:\java_udf.

The following statements register the JAR file with the JUDF database and create an SQL identifier called Report_JAR for the JAR file:

DATABASE JUDF;
CALL SQLJ.INSTALL_JAR('CJ?C:\java_udf\reports.jar', 'Report_JAR', 0);

For more information on how to register archive files for a Java external routine, see Registering and Distributing JAR and ZIP Files for Java External Routines.