|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.activity.Activity | +--uk.org.ogsadai.activity.sql.AbstractSQLActivity | +--uk.org.ogsadai.activity.sql.SQLBulkLoadRowSetActivity
Bulk loads data, provided in the WebRowSet format, into a table. This activity performs an insert for each row in the input data.
The bulk load can be performed transactionally, meaning that all previously completed inserts will be rolled back if an insert fails.
For information on this activity see the OGSA-DAI user doc:
OGSA-DAI/doc/interaction/activities/relational/sqlBulkLoadRowSet.html
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE
Copyright statement |
static java.lang.String |
LOAD_INTO_TABLE
Activity XML constant |
private static DAILogger |
LOG
Logger object for logging in this class |
private java.sql.Connection |
mConnection
JDBC database connection handler |
private boolean |
mFinishedProcessing
Finished processing? |
private BlockReader |
mInput
Activity input - WebRowSet |
private boolean |
mIsTransaction
Execute transactionally? |
private ParameterList |
mParameters
SQL expression parameters |
private java.lang.String |
mTableName
Name of the table to bulk load to |
private int |
mTotalInsertCount
Total number of rows processed |
private int |
mUpdateCount
Update count |
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 | |
SQLBulkLoadRowSetActivity(org.w3c.dom.Element element)
Constructs an activity using the specified element. |
Method Summary | |
private java.lang.String |
buildExpressionAndParameters(java.sql.ResultSet resultSet)
Build bulk load expression and parameters. |
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. |
private void |
endProcessing()
Finish execution and clean up. |
void |
initialise()
This method should be overridden by subclasses to perform any initialisation they require before the process
method invocations begin. |
private void |
parseInputStream(org.w3c.dom.NodeList inputNL)
Gets the name of the activity's input stream. |
private void |
parseTableName(org.w3c.dom.NodeList tableList)
Gets the name of the table to bulk load into and also whether the activity is to be transational. |
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.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 |
private static final java.lang.String COPYRIGHT_NOTICE
private static DAILogger LOG
private java.sql.Connection mConnection
public static java.lang.String LOAD_INTO_TABLE
private int mUpdateCount
private int mTotalInsertCount
private boolean mFinishedProcessing
private BlockReader mInput
private ParameterList mParameters
private java.lang.String mTableName
private boolean mIsTransaction
Constructor Detail |
public SQLBulkLoadRowSetActivity(org.w3c.dom.Element element) throws ActivitySpecificationException, ActivityCreationException
element
- Element
to configure the activity with - from a
perform document.
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
.Method Detail |
public void initialise() throws ActivitySpecificationException, ActivityExecutionException
Activity
process
method invocations begin. This might be used for setting up
convenient fields to reference objects contained in the
context. It shouldn't be used for opening resources.
That should be done in processFirst
.
initialise
in class AbstractSQLActivity
ActivityExecutionException
- If some system problem prevents the activity from
initialising.
ActivitySpecificationException
- If a problem with settings provided by a client prevents
the activity from initialising.protected void processFirst()
Activity
processFirst
in class Activity
protected void processBlock()
Activity
setCompleted
method to indicate that
processing is complete, or the setError
method if
an error occurs that will prevent the processing from
completing.
processBlock
in class Activity
private void endProcessing()
protected void cleanUp()
Activity
Activity
implementations that need to free up resources in the event of
an error or intermediate termination of the activity
processing.
cleanUp
in class Activity
private void parseInputStream(org.w3c.dom.NodeList inputNL) throws ActivitySpecificationException
inputNL
- Elements with name
attributes. First node in the
list has the value of the name
attribute
returned.
ActivitySpecificationException
- If there are no elements in the list.private void parseTableName(org.w3c.dom.NodeList tableList)
tableList
- Elements with tableName
and
transactionallity
attributes. First node in the
list has the value of these attributes extracted.private java.lang.String buildExpressionAndParameters(java.sql.ResultSet resultSet) throws java.sql.SQLException
resultSet
- Data to bulk load
java.sql.SQLException
- If any problems arise in the driver.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |