Testing Stored Procedures Deployed in Packages

For stored procedures deployed in packages, access the stored procedure by the package name and/or the stored procedure name set during deployment. The package name may be the default name taken from the project or another name entered during deployment. The stored procedure name may be the default name taken from the method name or a name chosen for the stored procedure during deployment. Stored Procedures may also be deployed without packages.

For example, assume a public static method hello()is in the Java package Welcome and the public class Greeting . Further assume it is deployed in a package Openings.


package Welcome;

  public class Greeting {

    public static String Hello() {

      return "Hello World!";

    }

  }    

You could execute a PL/SQL query to the deployed stored procedure that executes the public static method deployed there and returns the result. To invoke SQL*Plus from within JDeveloper, right-click a connection or select it from the Tools menu.

With a working connection to the database, your SQL*Plus client could execute the following:


select Openings.Hello() from dual;

Openings.Hello()

    

Executing the code displays:


Hello World!

    

Note: The reference to the stored procedure call spec uses package.method syntax; the name of the class from which the method originated is not part of the call.


Testing Stored Procedures
Testing Stored Procedures Deployed Separately

 

Copyright © 1997, 2004, Oracle. All rights reserved.