uk.org.ogsadai.activity.sql
Class SQLUpdateStatementActivity

java.lang.Object
  |
  +--uk.org.ogsadai.activity.Activity
        |
        +--uk.org.ogsadai.activity.sql.AbstractSQLActivity
              |
              +--uk.org.ogsadai.activity.sql.AbstractParameterisedSQLActivity
                    |
                    +--uk.org.ogsadai.activity.sql.SQLUpdateStatementActivity

public class SQLUpdateStatementActivity
extends AbstractParameterisedSQLActivity

Executes one or a sequence of SQL update statements across a JDBC connection.

The activity output is an XML fragment of form:

  <resultStream updateCount="N"/>
 

The credentials of the user should be available to obtain a connection from the JDBCConnectionProvider.

For information on this activity see the OGSA-DAI user doc: OGSA-DAI/doc/interaction/activities/relational/sqlUpdateStatement.html

Author:
The OGSA-DAI Project Team.

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private static DAILogger LOG
          Logger object for logging in this class
private  java.sql.Connection mConnection
          JDBC connection handler
private  int mTotalUpdateCount
          Current update count
static java.lang.String UPDATE_COUNT_POSTFIX
          Constant used to build activity output
static java.lang.String UPDATE_COUNT_PREFIX
          Constant used to build activity output
 
Fields inherited from class uk.org.ogsadai.activity.sql.AbstractParameterisedSQLActivity
mParameters
 
Fields inherited from class uk.org.ogsadai.activity.sql.AbstractSQLActivity
CREATE_DATABASE, DROP_DATABASE, EXPRESSION, mCredentials, mDataResource, mExpression, mInputStreamNames, mOutput, mStatement, RESULT_STREAM, SQL_OUT_PARAMETERS, SQL_PARAMETERS, STORED_PROCEDURE, WEB_ROW_SET_STREAM
 
Fields inherited from class uk.org.ogsadai.activity.Activity
mContext, mExternalInputs, mExternalOutputs, mInternalInputs, mInternalOutputs
 
Constructor Summary
SQLUpdateStatementActivity(org.w3c.dom.Element element)
          Constructs an activity using the specified element.
 
Method Summary
protected  void cleanUp()
          This method can be overridden by any Activity implementations that need to free up resources in the event of an error or intermediate termination of the activity processing.
protected  void processBlock()
          Performs an iteration of the processing of an activity.
protected  void processFirst()
          This method is called during the first iteration of processing an activity.
 
Methods inherited from class uk.org.ogsadai.activity.sql.AbstractParameterisedSQLActivity
initialise, initialiseInputStreamNames, parseSQLParameters
 
Methods inherited from class uk.org.ogsadai.activity.sql.AbstractSQLActivity
createOutputPipe, parseExpression, parseResultStream
 
Methods inherited from class uk.org.ogsadai.activity.Activity
connectsTo, getActivityConfiguration, getActivityName, getCause, getName, getObservableStatus, getProperties, getSession, getStatus, hasActivityConfiguration, hasProperties, process, setActivityName, setCompleted, setError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values

LOG

private static DAILogger LOG
Logger object for logging in this class


mConnection

private java.sql.Connection mConnection
JDBC connection handler


mTotalUpdateCount

private int mTotalUpdateCount
Current update count


UPDATE_COUNT_PREFIX

public static final java.lang.String UPDATE_COUNT_PREFIX
Constant used to build activity output

See Also:
Constant Field Values

UPDATE_COUNT_POSTFIX

public static final java.lang.String UPDATE_COUNT_POSTFIX
Constant used to build activity output

See Also:
Constant Field Values
Constructor Detail

SQLUpdateStatementActivity

public SQLUpdateStatementActivity(org.w3c.dom.Element element)
                           throws ActivitySpecificationException,
                                  ActivityCreationException
Constructs an activity using the specified element.

Parameters:
element - Element to configure the activity with - from a perform document.
Throws:
ActivityCreationException - If there is a problem constructing the activity.
ActivitySpecificationException - If there is a problem constructing the activity due to an invalid setting in element.
See Also:
uk.org.ogsadai.activity
Method Detail

processFirst

protected void processFirst()
Description copied from class: Activity
This method is called during the first iteration of processing an activity. It can be overridden by subclasses to define some processing that should be done only once during the first iteration of the activity processing, for example evaluating a database query.

Overrides:
processFirst in class Activity

processBlock

protected void processBlock()
Description copied from class: Activity
Performs an iteration of the processing of an activity. This may involve reading a block of input data and writing a block of output data, or may involve some other kind of processing. When an activity is processed by the OGSA-DAI engine, this method will be invoked repeatedly until the activity either completes or stops due to an error or termination call. An implementation of this method should invoke the setCompleted method to indicate that processing is complete, or the setError method if an error occurs that will prevent the processing from completing.

Specified by:
processBlock in class Activity

cleanUp

protected void cleanUp()
Description copied from class: Activity
This method can be overridden by any Activity implementations that need to free up resources in the event of an error or intermediate termination of the activity processing.

Overrides:
cleanUp in class Activity