Contents Index Printing to the command line Scope and persistence

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

Using the main method


When a class contains a main method matching the following declaration, most Java run time environments, such as the Sun Java interpreter, execute it automatically. Normally, this static method executes only if it is the class being invoked by the Java interpreter

public static void main( String args[ ] ) { }

Useful for testing the functionality of Java objects, you are always guaranteed this method will be called first, when the Sun Java runtime system starts.

In Adaptive Server Anywhere, the Java runtime system is always available. The functionality of objects and methods can be tested in an ad hoc, dynamic manner using SQL statements. In many ways this is far more flexible for testing Java class functionality.


Contents Index Printing to the command line Scope and persistence