Java™ Shared-Object File

To specify the name of a Java™ shared-object file, specify the name of the static Java™ method to which the UDR corresponds and the location of the Java™ binary that defines the method.

(1)
Java™ Shared-Object File

1  quote  %Jar Name1  :? +  package_id .  class_id . method_id?  (? + , java_type ) RETURNS java_type  quote
Notes:
Element Description Restrictions Syntax
class_id Java™ class whose method implements the UDR Class must exist in the .jar file that Jar Name identifies Must conform to rules for Java™ identifiers
java_type Java™ data type for a parameter in the Java-method signature Must be defined in a JDBC class or by an SQL-to-Java mapping Must conform to rules for Java™ identifiers
method_id Name of the Java™ method that implements the UDR Must exist in the Java™ class that java_class_name specifies Must conform to rules for Java™ identifiers
package_id Name of package that contains the Java™ class Must exist Must conform to rules for Java™ identifiers
quote Single ( ' ) or double ( '' ) quotation mark delimiters Opening and closing quotation marks must match Literal symbol ( ' or '' ) entered at the keyboard
Before you can create a UDR written in the Java™ language, you must assign a jar identifier to the external jar file with the sqlj.install_jar procedure. (For more information, see sqlj.install_jar.) You can include the Java™ signature of the method that implements the UDR in the shared-object filename.
  • If you do not specify the Java™ signature, the routine manager determines the implicit Java™ signature from the SQL signature in the CREATE FUNCTION or CREATE PROCEDURE statement.

    It maps SQL data types to the corresponding Java™ data types with the JDBC and SQL-to-Java mappings. For information on mapping user-defined data types to Java™ data types, see sqlj.setUDTextName.

  • If you do specify the Java™ signature, the routine manager uses this explicit Java™ signature as the name of the Java™ method to use.
For example, if the Java™ method explosiveReaction( ) implements the Java™ UDR sql_explosive_reaction( ) as discussed in sqlj.install_jar, its shared-object filename could be:
course_jar:Chemistry.explosiveReaction
The preceding shared-object filename provides an implicit Java™ signature. The following shared-object filename is the equivalent with an explicit Java™ signature:
course_jar:Chemistry.explosiveReaction(int)