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

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.SQLUpdate

public class SQLUpdate
extends ParameterizedActivity

This activity executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement. It has no inputs and one output that contains the number of rows modified by the statement.

Author:
The OGSA-DAI Project Team

Constructor Summary
SQLUpdate(java.lang.String expression)
          Constructs a SQL update with the given expression.
 
Method Summary
protected  java.lang.String generateXML()
          Generates the XML representing the activity.
 java.lang.String getExpression()
          Gets the SQL update expression.
 int getModifiedRowsCount()
          Returns the number of rows modified by the update.
 ActivityOutput getOutput()
          Gets the activity's only output.
 
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

SQLUpdate

public SQLUpdate(java.lang.String expression)
Constructs a SQL update with the given expression.

Parameters:
expression - SQL expression to executed
Method Detail

getExpression

public java.lang.String getExpression()
Gets the SQL update expression.

Returns:
the SQL update expression

getModifiedRowsCount

public int getModifiedRowsCount()
                         throws ActivityOutputException,
                                DataFormatException
Returns the number of rows modified by the update. This is the only output from the activity.

Returns:
number of rows modified by the update
Throws:
DataFormatException - If the output data is not in the expected format.
ActivityOutputException - If there is no output data.

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