15.00 - JAR Files - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1184-015K
Language
English (United States)

JAR Files

A JAR file (JAR is an initialism for Java ARchive) is an archive of a collection of Java classes in a zip file format and is somewhat analogous to a DLL file. The classes (byte compiled Java) are referenced when an external Java routine is created by means of the EXTERNAL NAME clause of CREATE PROCEDURE (External Form).

JAR files are always created outside of the database. Before you can reference a class, you must register it and copy it into the SQL environment. Once a JAR has been installed in the database, you cannot change its content in any way. You are restricted to either deleting a JAR file or replacing it in its entirety.

JAR files are available only to the user who installs them by means of a call to the SQLJ.Install_Jar external procedure (see “SQLJ Database” on page 435 and SQL External Routine Programming for information about this procedure). Analogous to the infrastructure for C and C++ external routines, the system creates a directory on the platform for each database that contains a JAR. Analogous to the fact that C and C++ DLLs created for 1 or more external routines in a given database cannot be accessed by other users or databases, so JAR files created for a Java external routine cannot be accessed by other users or databases.

There are no specific privileges for JAR files. Therefore, user or database A cannot create an external procedure that references a JAR installed in user or database B. However, user or database A can be granted access to a Java external procedure that has been created in user or database B by using the same privileges as are used for C and C++ external routines (see “GRANT (SQL Form)” in SQL Data Control Language for information on how to do this).

One way to ensure such ready access to Java external procedures is to install all JAR files and create all Java external procedures in the same database and then grant access to them for all users who must execute them.

See SQL External Routine Programming for details.