You can install Java classes in Adaptive Server, and then invoke the static methods of those classes in two ways:
You can invoke the Java methods directly in SQL.
You can wrap the methods in SQL names and invoke them as you would standard Transact-SQL stored procedures.
The methods of an object-oriented language correspond to the functions of a procedural language. You can invoke methods stored in the database by referencing them, with name qualification, on instances for instance methods, and on either instances or classes for static (class) methods. You can invoke the method directly in, for example, Transact-SQL select lists and where clauses.
You can use static methods that return a value to the caller as user-defined functions (UDFs).
Certain restrictions apply when using Java methods in this way:
If the Java method accesses the database through JDBC, result-set values are available only to the Java method, not to the client application.
Output parameters are not supported. A method can manipulate the data it receives from a JDBC connection, but the only value it can return to its caller is a single return value declared as part of its definition.
You can enclose Java static methods in SQL wrappers and use them exactly as you would Transact-SQL stored procedures or built-in functions. This functionality:
Allows Java methods to return output parameters and result sets to the calling environment.
Allows you to take advantage of traditional SQL syntax, metadata, and permission capabilities.
Allows you to invoke SQLJ functions across databases.
Allows you to use existing Java methods as SQLJ procedures and functions on the server, on the client, and on any SQLJ-compliant, third-party database.
Complies with Part 1 of the standard specification. See “Standards”.