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:
|
To add the stored procedure into a JReport catalog, follow the steps below:
DRIVER=com.edb.Driver&URL="jdbc:edb://222.222.222.45:5444/edb"&USER=enterprisedb&PSWD=db1234&OWNER=enterprisedb&PROCNAME=empquery&SQL={call empquery(?,?)}&REFCURSORINDEX=2&PARAMVALUE=@job1
DRIVER=com.edb.Driver&URL="jdbc:edb://222.222.222.45:5444/edb"&USER=enterprisedb&PSWD=db1234&OWNER=enterprisedb&PROCNAME=empquery&SQL={call empquery(?,?)}&REFCURSORINDEX=2&INPARAMVALUE=@job1,varchar,1
OWNER=enterprisedb&PROCNAME=empquery&SQL={call empquery(?,?)}&REFCURSORINDEX=2&PARAMVALUE=@job1