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

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

public class SQLBulkLoad
extends Activity

This activity bulk loads data into a table within a relational database. A typical application of this activity would be to insert data generated by an SQLQuery activity into another table.

The activity has one input and one output. The input must be XML data formatted using the WebRowSet standard, such as that generated by an SQLQuery activity. The output consists of a count of the number of rows inserted into the table.

Note that the destination table must exist before this activity is processed, and the table column names must match those contained in the WebRowSet input data.

Author:
The OGSA-DAI Project Team

Constructor Summary
SQLBulkLoad(ActivityOutput inputSource, java.lang.String tableName)
          Constructs an SQL bulk load activity.
 
Method Summary
protected  java.lang.String generateXML()
          Generates the XML representing the activity.
 ActivityOutput getInputSource()
          Gets the activity's input source which will be another activity's output.
 int getInsertedRowsCount()
          Gets the number of rows inserted into the table as a result of the bulk load operation.
 ActivityOutput getOutput()
          Gets the activity's only output.
 java.lang.String getTableName()
          Gets the name of the database table into which the data will be inserted.
 boolean isTransactionally()
          Gets whether this bulk load is performed in a transactional manner.
 void setTransactionally(boolean transactionally)
          Sets whether this bulk load is performed in a transactional manner.
 
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

SQLBulkLoad

public SQLBulkLoad(ActivityOutput inputSource,
                   java.lang.String tableName)
Constructs an SQL bulk load activity.

Parameters:
inputSource - activty output that provides the input
tableName - name of table to write to
Method Detail

setTransactionally

public void setTransactionally(boolean transactionally)
Sets whether this bulk load is performed in a transactional manner.

Parameters:
transactionally - true if the bulk load is transactional, false otherwise

isTransactionally

public boolean isTransactionally()
Gets whether this bulk load is performed in a transactional manner.

Returns:
true if the bulk load is transactional,
false otherwise

getInputSource

public ActivityOutput getInputSource()
Gets the activity's input source which will be another activity's output.

Returns:
the input source

getTableName

public java.lang.String getTableName()
Gets the name of the database table into which the data will be inserted.

Returns:
name of database table

getInsertedRowsCount

public int getInsertedRowsCount()
                         throws DataFormatException,
                                ActivityOutputException
Gets the number of rows inserted into the table as a result of the bulk load operation.

Returns:
The number of rows inserted
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