Scalable Database Server, HiRDB Version 8 UAP Development Guide

[Contents][Index][Back][Next]

9.4.2 Package, class, and method definitions

This section describes the points to be observed when defining packages, classes, and methods. For details about the packages, classes, and methods, see the manual provided with JDK.

Organization of this subsection
(1) Package
(2) Class
(3) Method

(1) Package

  1. Specification of a package name is optional.
  2. If you specify the package name, the length of the package-name.class-name character string must be no longer than 255 characters.
  3. You cannot use either of the following package names:
    • Package name existing in JRE
    • Package name provided by HiRDB

(2) Class

  1. A class name must be no longer than 255 characters.
  2. Define a class in the format public class <class-name>.

(3) Method

  1. A method name must be no longer than 255 characters.
  2. Define a method as follows:
    Java stored procedure
    public static void <method-name>
    Java stored function
    public static <return-value> <method-name>
  3. If there is a possibility of an exception occurring in the method, you must either declare the exception in the throw section or specify try.catch. For Java stored procedures, there is a possibility of an SQLException exception occurring in nearly all JDBC methods.
  4. A method can reference a class included in the Java platform core API or a class included in the JAR file that contains the current method.