EnterpriseDB stored procedure UDS

Due to the unique nature of EnterpriseDB stored procedures, you cannot add them directly into a JReport catalog. In this sense, the usage of JReport Designer is limited when you use an EnterpriseDB database. 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.

Adding an EnterpriseDB stored procedure

Suppose that the 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 Browser, right-click the data source 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.enterprisedb.EnterpriseDbProcedureUDS.
  5. In the Parameter box, enter any of the following three:
  6. Click OK, and the UDS class will be added into the catalog.