The UDS class

To use stored procedures in Oracle with JReport Designer, JReport developed a user data source class. The class is named OracleProcedureUDS, and can be found in the package jet.datasource.oracle.

In the Add User Defined Data Source dialog, the format of the PARAMETER string is in either of the following. You can choose one according to your requirement. When the stored procedures used in Oracle have different names, either of the following two formats can be used. However, when the stored procedures used in Oracle have same names, you can only use the second PARAMETER string.

Note: When you use the second PARAMETER string listed above, the parameter value only contains value. You need to add the data type and index of the parameter value in the user defined data source class.

Substitute the words in lower case according to your requirements.

Where:

An example of the PARAMETER string

DRIVER=oracle.jdbc.driver.OracleDriver&URL="jdbc:oracle:thin:@dbserver:1521:orcl" &USER=scott&PSWD=tiger&OWNER=SCOTT&PROCNAME=getAuthor&SQL={call getAuthor(?, ?, ?}&REFCURSORINDEX=2&PARAMVALUE=0.5,1999-7-10

If you want to change the connection dynamically, you can define the parameters in this way:

oracle.jdbc.driver.OracleDriver=@driver, jdbc:oracle:thin:@dbserver:1521:orcl=@url, scott=@user,

The PARAMETER string will then be either of the following:

You can change the parameter dynamically to suit your requirements.

Note: When your PARAMETER string contains characters such as: At sign(@), ':', double quotation mark('"'), or other strings that do not need to be parsed by JReport, you can use a pair of double quotation marks to quote them. For example, your PARAMETER string may be:

jdbc:oracle:thin:@204.177.148.30:1521:orcl

Here, @ is a character used by the URL. If you add this PARAMETER string into a catalog, JReport will regard 204 as the name of a parameter in the catalog. The correct form is:

"jdbc:oracle:thin:@204.177.148.30:1521:orcl"