BackPrevious Page Next PageNext

EnterpriseDB Stored Procedure UDS

Due to the unique nature of EnterpriseDB stored procedures, you cannot add them directly into a JReport catalog. As a substitute, JReport has developed the user data source API which can use stored procedures in EnterpriseDB. The usage of EnterpriseDB stored procedures is the same as that of Oracle stored procedures, except that the class name for EnterpriseDB stored procedures is EnterpriseDbProcedureUDS, in the package jet.datasource.enterprisedb. This class is already included in JReport Designer and JReport Server so you do not need to write any code or modify the classpath.

The following shows an example of adding an EnterpriseDB stored procedure to a catalog.

Suppose that an EnterpriseDB stored procedure is defined as follows:

create or replace package shdemo
      as
      type curtype
      is
ref
cursor;
end shdemo;
      

create or replace procedure empquery (param1 in varchar2, cur out shdemo.curtype) as lcur shdemo.curtype; begin open lcur for select * from emp where job = param1; cur:=lcur; end empquery;

To add the stored procedure into a JReport catalog, follow the steps below:

  1. Start JReport Designer and open the catalog to which you want to add the stored procedure.
  2. In the Catalog Manager, right-click the data source the stored procedure is to be added, then select New User Defined Data Source. The New User Defined Data Source dialog appears.
  3. In the Name field, specify a name for the UDS, for example, UDS1.
  4. In the Class Name field, input the UDS class jet.datasource.enterprisedb.EnterpriseDbProcedureUDS.
  5. In the Parameter box, enter any of the following three:

    Add User Defined Data Source dialog

  6. Click OK, and the UDS class will be added into the catalog.

BackPrevious Page Next PageNext