|
|||||||||||
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.AbstractParameterisedSQLActivity | +--uk.org.ogsadai.activity.sql.SQLStoredProcedureActivity
Executes a stored procedure across a JDBC connection. The output is a sequence of blocks. Each block is an object of one of the following types:
java.sql.ResultSet
<resultStream updateCount="N"/>
java.util.Map
mapping the position of an output parameter
(which has been registered before the stored procedure was executed) to
its value
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/sqlStoredProcedure.html
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 database connection handler |
private boolean |
mFinishedProcessing
Indicates whether processing is complete |
private boolean |
mGetMoreResults
Are there more results to get? |
private boolean |
mIsResultSet
Is the current result a java.sql.ResultSet ? |
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 | |
SQLStoredProcedureActivity(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. |
private java.lang.String |
getExpression(int numParameters)
Constructs the expression for calling the stored procedure |
private java.lang.String |
getStream(org.w3c.dom.NodeList nodelist)
Gets the name of the activity's output stream. |
private void |
parseOutParameters(org.w3c.dom.NodeList nodelist)
Parses the SQL out parameters for the stored procedure and saves these. |
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 |
private static final java.lang.String COPYRIGHT_NOTICE
private static DAILogger LOG
private java.sql.Connection mConnection
private boolean mFinishedProcessing
private boolean mGetMoreResults
private boolean mIsResultSet
java.sql.ResultSet
?
Constructor Detail |
public SQLStoredProcedureActivity(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 |
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
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 java.lang.String getExpression(int numParameters)
numParameters
- the number of parameters that will be passed to the procedure
private java.lang.String getStream(org.w3c.dom.NodeList nodelist)
nodelist
- Elements with name
attributes. First node in
the list has the value of the name
attribute
returned.
private void parseOutParameters(org.w3c.dom.NodeList nodelist) throws ActivitySpecificationException
nodelist
- Elements with position
and type
attributes. Each element is assumed to declare one SQL out
parameter.
ActivitySpecificationException
- If the attributes have non-integer values.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |