Importing Stored Procedures

Virtual DataPort provides an API to develop custom stored procedures in Java. The section Developing Stored Procedures explains how to do it.

To create a stored procedure, first you need to upload to Virtual DataPort the jar file that contains the stored procedure. To do this, follow these steps:

  1. Click the menu File > Extension management.

  2. In the tab Extensions, click Import and select the jar file(s) of the extension and click Ok. This will upload the jar files.

After uploading the jar file, click the menu File > New > Stored procedure. The Tool will display this dialog:

Importing a Stored Procedure

Importing a Stored Procedure

You have to provide the following settings:

  • Name. Name of the new stored procedure. In our example, _CalculateAvgRevenue_.

  • Select Select jars and in the box below, select the jar file that contains the stored procedure.

  • In Class name, select the Java class that implements the stored procedure.

  • Classpath. Leave this empty. This field is provided only for backward compatibility.

  • In the Metadata tab, you can define the folder where the stored procedure will be stored and enter its description.

Click Save (image1) to create the base view. The Tool will display a dialog with the properties of the new stored procedure and its input and output parameters (see Properties of a Stored Procedure).

The parameters of a stored procedure can be of types IN, OUT or IN_OUT. The IN parameters are the required input parameters to execute the procedure; the OUT parameters are the ones returned by the execution of the procedure; and the IN_OUT parameters are input parameters that are also returned by the procedure.

The “Nullable” column indicates that the value of that parameter can be NULL.

The figure below shows information about the new stored procedure: It has an input parameter (IN) called taxid_list, of type array, and an output parameter avgrevenue(OUT), of type double.

Properties of a Stored Procedure

Properties of a Stored Procedure