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.
Complies with Part 1 of the ANSI SQLJ standard specification.
Allows you to take advantage of traditional SQL syntax, metadata, and permission capabilities.
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.
Creating a SQLJ stored procedure or function
Perform these steps to create and execute a SQLJ stored procedure or function.
Create and compile the Java method. Install the method class in the database using the installjava utility.
Refer to Chapter 2, “Preparing for and Maintaining Java in the Database,” for information on creating, compiling, and installing Java methods in Adaptive Server.
Using the SQLJ create procedure or create function statement, define a SQL name for the method.
Execute the procedure or function. The examples in this chapter use JDBC method calls or isql. You can also execute the method using Embedded SQL or ODBC.