Neoview Guide to Stored Procedures in Java (R2.5)
5 Creating SPJs in the Neoview Database
After uploading the SPJ JAR files to the Neoview platform, you can create the procedures in the
Neoview database. To create or drop a procedure from the Neoview database, use the HP
Database Manager (HPDM).
Follow these procedures:
• “Create a Procedure” (page 37)
• “Drop a Procedure” (page 40)
• “Display Procedures and Their Properties” (page 41)
This chapter also covers:
• “Required Privileges for Creating or Dropping an SPJ”
• “Altering an SPJ and Its Java Bytecode” (page 44)
Required Privileges for Creating or Dropping an SPJ
To create an SPJ in a schema, your user role must be the schema owner, or you must have the
CREATE_PROCEDURE privilege for that schema.
To drop an SPJ from a schema, your user role must be the schema owner, or you must have the
DROP_PROCEDURE privilege for that schema. For more information about the
DROP_PROCEDURE and CREATE_PROCEDURE privileges, see the GRANT SCHEMA statement
in the Neoview SQL Reference Manual.
To display the current ownership and privileges, see “Display Procedures and Their Properties”
(page 41).
Create a Procedure
Create Procedure registers an existing Java method as a stored procedure in Java (SPJ) within
Neoview SQL.
NOTE: HPDM creates procedures with default privileges only.
Requirements:
• You must be the owner of the schema or have SUPER.SUPER or SUPER.SERVICES privileges,
and have read access to the .jar file that contains the SPJ Java method.
• The catalog and schema of the SPJ must already exist.
To create a procedure:
1. In HPDM, select the Database area.
2. Expand the navigation tree pane so that you can see the name of the schema in which you
want to create the procedure and the Procedures folder under the schema.
3. Right-click the Procedures folder, and select Create Procedure. The Create Procedure
dialog box appears.
4. In the Name field, enter a name for the stored procedure. For detailed information about
the Name field, see “Use the Create Procedure Dialog Box” (page 39).
5. In the Code group box, click [ Browse ] to open the Procedure Code File Browser. Use
the browser to select a method from a JAR file.
Required Privileges for Creating or Dropping an SPJ 37