uk.org.ogsadai.client.toolkit.activity.sql
Class SQLStoredProcedure

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.activity.RequestComponent
        |
        +--uk.org.ogsadai.client.toolkit.activity.Activity
              |
              +--uk.org.ogsadai.client.toolkit.activity.ParameterizedActivity
                    |
                    +--uk.org.ogsadai.client.toolkit.activity.sql.SQLStoredProcedure

public class SQLStoredProcedure
extends ParameterizedActivity

This activity evaluates a stored procedure within a relational database. A stored procedure may generate a result set, multiple result sets, an update count or no result data at all. This activity has no inputs and one output. The format of the output data depends on the behaviour of the stored procedure, so it may contain any of the following:

Author:
The OGSA-DAI Project Team

Constructor Summary
SQLStoredProcedure(java.lang.String procedureName)
          Constructs activity to execute the named stored procedure.
 
Method Summary
protected  java.lang.String generateXML()
          Generates the XML representing the activity.
 int getModifiedRowsCount()
          Gets the update count returned by the stored procedure.
 ActivityOutput getOutput()
          Gets the activity's only output.
 java.lang.String getProcedureName()
          Gets the SQL stored procedure name.
 java.sql.ResultSet getResultSet()
          Gets the result set containing the result of executing the stored procedure.
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.ParameterizedActivity
clearParameters, generateParametersXML, setParameter, setParameter
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
addInput, addOutput, addOutputs, getDataResourceID, getDataServiceStub, getInputParameters, getOutputParameters, getOutputs, replaceSpecialCharacters, setDataResourceID, setDataServiceStub, setInput
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLStoredProcedure

public SQLStoredProcedure(java.lang.String procedureName)
Constructs activity to execute the named stored procedure. The parameters passed to the stored procedure must be subsequently added using the setParameter method.

Parameters:
procedureName - name of the stored procedure to execute
Method Detail

getProcedureName

public java.lang.String getProcedureName()
Gets the SQL stored procedure name.

Returns:
the SQL stored procedure name

getResultSet

public java.sql.ResultSet getResultSet()
                                throws ActivityOutputException,
                                       DataFormatException
Gets the result set containing the result of executing the stored procedure.

Not there is no guarantee that the store procedure does return a single result set in which case the DataFormatException exception will be thrown.

Returns:
ResultSet containing result of executing the stored procedure.
Throws:
DataFormatException - If the output data is not in the single WebRowSet format.
ActivityOutputException - If there is no output data.

getModifiedRowsCount

public int getModifiedRowsCount()
                         throws ActivityOutputException,
                                DataFormatException
Gets the update count returned by the stored procedure.

Not there is no guarantee that the stored procedure does return an update count in which case the DataFormatException exception will be thrown.

Returns:
the number of modified rows (the update count)
Throws:
ActivityOutputException
DataFormatException

getOutput

public ActivityOutput getOutput()
Gets the activity's only output.

Returns:
the activity output.

generateXML

protected java.lang.String generateXML()
Description copied from class: RequestComponent
Generates the XML representing the activity. This XML can then be inserted into a perform document that is sent to a data service.

Specified by:
generateXML in class Activity
Returns:
the XML for the activity