Overview

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:

StepsCreating a SQLJ stored procedure or function

Perform these steps to create and execute a SQLJ stored procedure or function.

  1. 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.

  2. Using the SQLJ create procedure or create function statement, define a SQL name for the method.

  3. 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.