Example 1: Stored procedures defined outside of a package

Suppose that the Oracle stored procedure is defined as:

CREATE OR REPLACE PACKAGE SHDEMO as
type curtype is ref cursor;
END SHDEMO;
CREATE OR REPLACE PROCEDURE empquery (p_job in varchar2, cur OUT SHDEMO.curtype) as
lcur SHDEMO.curtype;
begin
  open lcur for
  select * from EMP WHERE JOB = p_job;
  cur:=lcur;
END empquery;
To add the stored procedure into a JReport catalog, follow the steps below:
  1. Start JReport Designer and open an existing catalog.
  2. In the Data tab of the Catalog Browser, right-click the data source to which the stored procedure is to be added, then select Add User Defined Data Source.
  3. In the Name field of the Add User Defined Data Source dialog, specify a name for the UDS.
  4. In the Class Name field, input the UDS class jet.datasource.oracle.OracleProcedureUDS.
  5. In the Parameters box, enter one of the following:
  6. Click the OK button, and the UDS class will then be added into the catalog.