Contents Index Using the main method Java escape characters in SQL statements

ASA Programming Guide
  Introduction to Java in the Database
    The runtime environment for Java in the database

Scope and persistence


SQL variables are persistent only for the duration of the connection. This is unchanged from previous versions of Adaptive Server Anywhere, and is unaffected by whether the variable is a Java class or a native SQL data type.

The persistence of Java classes is analogous to tables in a database: tables exist in the database until you drop them, regardless of whether they hold data or even whether they are ever used. Java classes installed to a database are similar: they are available for use until you explicitly remove them with a REMOVE JAVA statement.

For more information on removing classes, see REMOVE statement.

A class method in an installed Java class can be called at any time from a SQL statement. You can execute the following statement anywhere you can execute SQL statements.

SELECT java.lang.Math.abs(-342)

A Java object is only available in two forms: as the value of a variable, or as a value in a table.


Contents Index Using the main method Java escape characters in SQL statements