Importing Java Stored Procedures¶
Virtual DataPort provides a Java API to develop your own stored procedures. The section Developing Java 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 upload it, follow these steps:
Click the menu File > Extension management.
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. You will see this dialog:
Enter this:
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 () to create the stored procedure. 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
.