You use CREATE PROCEDURE or CREATE FUNCTION to define an external Java stored routine. CREATE PROCEDURE or CREATE FUNCTION defines the association of a Java method with the procedure name or function name.
- Java stored procedure
Use CREATE PROCEDURE to register a Java method as a Java stored procedure.
- Java stored function
Use CREATE FUNCTION to register a Java method as a Java stored function.
The following figure shows an example of an external Java stored routine definition.
Figure 9-7 Example of an external Java stored routine definition
![[Figure]](FIGURE/ZU090070.GIF)
- Defining public routines
- To use an external Java stored routine defined by another user, you must specify its owner's authorization identifier and the routine identifier when you call the stored routine from within the UAP.
- However, if the external Java stored routine was defined as a public routine by executing CREATE PUBLIC PROCEDURE or CREATE PUBLIC FUNCTION, then there is no need to specify the owner's authorization identifier when the stored routine is called from within a UAP (only the routine identifier needs to be specified).
- Redefining external Java stored routines
- You use ALTER PROCEDURE or ALTER ROUTINE to redefine an external Java stored routine, such as when you need to make changes to the Java program.
- Deleting external Java stored routines
- You use DROP PROCEDURE or DROP FUNCTION to delete an external Java stored routine.
- To delete a public routine, use DROP PUBLIC PROCEDURE or DROP PUBLIC FUNCTION. Note that a public routine can be deleted only by the user who defined it or by a user with the DBA privilege.
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.