Specify the external name

The following diagram details the external-name portion of the CREATE ROUTINE (or FUNCTION or PROCEDURE) statement for a UDR written in Java™ code.


1  EXTERNAL NAME %Java external name
Java external name

1  '
1 THISJAR
1 ? ?  database .  owner . jar_name
2  :
2 ?  package_name .  class_name.method
2  (? + , java_datatype )
2  '
Element Purpose Restrictions
class_name Class to which the UDR belongs Must be an existing class.
database Database where the jar exists If omitted, defaults to the current database. Must be an existing database.
jar_name JAR identifier as specified in the install_jar() statement Must be an existing JAR name.
java_datatype Name of a Java data type The second column of the following table shows data types and class names that you can use for this variable. Must be a Java data type.
method Name of the static method of the UDR Must be an existing method.
owner Owner of the jar. If omitted, default is the current user. Must be an existing user name.
package_name Name of a package Required if the UDR classes are in a package.

When used within a deployment descriptor, the THISJAR keyword automatically expands to the SQLJ-defined three-part JAR path.

The following table shows mapping between SQL data values and Java types. Use the values in the second column for the java_datatype variable.
Table 1. Mapping between SQL data values and Java types
SQL data type Java type
CHAR(1) char
CHAR(1) java.lang.Character
CHAR() Java.lang.String
CHARACTER() java.lang.String
CHARACTER VARYING() java.lang.String
VARCHAR java.lang.String
LVARCHAR java.lang.String
SMALLINT short
SMALLINT java.lang.Short
INTEGER int
INTEGER java.lang.Integer
INT8 long
INT8 java.lang.Long
SMALLFLOAT float
SMALLFLOAT java.lang.Float
REAL float
REAL java.lang.Float
FLOAT double
FLOAT java.lang.Double
DOUBLE PRECISION double
DOUBLE PRECISION java.lang.Double
DECIMAL java.math.BigDecimal
MONEY java.math.BigDecimal
NUMERIC java.math.BigDecimal
BOOLEAN boolean
BOOLEAN java.lang.Boolean
DATE java.sql.Date
DATETIME HOUR TO SECOND java.sql.Time
DATETIME YEAR TO FRACTION java.sql.Timestamp
INTERVAL java.lang.String
BLOB java.sql.Blob
CLOB java.sql.Clob