SQL-J Language Reference,
Page 13 of 118


[top]
[prev]
[next]
Documentation Top
Global Index
Reference Manual
TOC Index
Grammar index
Developer's Guide
TOC Index
Tuning Cloudscape
TOC Index

CREATE METHOD ALIAS statement

CREATE METHOD ALIAS adds an alias for a static Java method, making it appear to be a native built-in function.

Method aliases are not defined within a particular schema.

Syntax

CREATE METHOD ALIAS MethodAlias
FOR { JavaClassName | ClassAlias }.JavaMethodName

The Java class must be a public class and available on the current system or database class path. The method must exist and be public. A method alias and a class alias can share the same name.

NEW: Validity checking for method alias creation is new in Version 3.0.

Examples

CREATE METHOD ALIAS ABS
FOR java.lang.Math.abs
CREATE METHOD ALIAS findCity
FOR JBMSTours.serializabletypes.City.findCity
-- City is an alias for JBMSTours.serializabletypes.City
CREATE METHOD ALIAS findCity
FOR City.findCity
-- a method alias and class alias can have
-- the same name
CREATE METHOD ALIAS City
FOR City.findCity

Once a method alias has been defined within a database, you refer to it with the alias alone:

VALUES ABS(-5)
VALUES findCity(getCurrentConnection(), 35)
[top]
[prev]
[next]


Cloudscape Version 3.0
For technical support, go to: www.cloudscape.com and click Support.
Copyright © 1998 and 1999 Cloudscape, Inc. All rights reserved.