SQL-J Language Reference
Page 119 of 121

NEW

Creates a new instance of the specified class.

Syntax

NEW [ JavaClassName | ClassAlias ]
    ( Expression [ , Expression]* )

You can place a NEW expression anywhere an expression is permitted. It invokes the constructor that matches the types of the expressions in the parameter list.

In the situation in which a class alias and a Java class name shared the same name, Cloudscape finds the Java class name first.

NEW Examples

INSERT INTO People (person) VALUES
(NEW JBMSTours.serializabletypes.Person(
    'George', 'Washington'))

-- Person is a ClassAlias
INSERT INTO People (person) VALUES
(NEW Person('Martha', 'Washington'))

For information on method resolution, see Method Resolution and Type Correspondence.