|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--uk.org.ogsadai.engine.Activity
|
+--uk.org.ogsadai.activity.sql.SQLActivity
|
+--uk.org.ogsadai.activity.sql.SQLStoredProcedureActivity
Handles SQLStoredProcedure Elements from a Grid Data Service Document.
The SQLStoredProcedureActivity is constructed from an Element corresponding to a statement
for execution on a database.
A Context can then be set detailing the environment in which this
activity exists. Where to obtain inputs from and send output too.
The credentials of the user should be available to obtain a connection
The activity can then be processed a block at a time. On the request for the first block the
activity will obtain a connection from the ConnectionManager, setup and execute the
statement and return the first block as defined within ResultSetToWebRowSetXMLStream
Subsequently each block will be returned until last block, at which point the statement is closed
the connection is returned to the ConnectionManager and the ouput closed.
If a prepared statement i sused then the engine will call finalise to indicate this connection is no longer
required and can be returned.
Current issues Only currently support writing one output stream from a webrowset Where should output go which doesn't have a specified OutputStream How will we handle setting up and/or changing block sizes? I currently just finish if one input stream has finished, i.e. no error flagged How can I ensure only querys are run using this activity, if I pass in an insert statement it carries out the statement before I notice an error
| Nested Class Summary |
| Nested classes inherited from class uk.org.ogsadai.activity.sql.SQLActivity |
SQLActivity.ParameterInput, SQLActivity.StreamInput, SQLActivity.ValueInput |
| Field Summary | |
protected boolean |
mIsQuery
|
protected ResultSetToWebRowSetXMLStream |
mRowset
|
protected int |
mUpdateCount
|
| Fields inherited from class uk.org.ogsadai.activity.sql.SQLActivity |
CREATE_DATABASE, DROP_DATABASE, EXPRESSION, mAllInput, mConnection, mConnectionManager, mCredentials, mExpression, mExpressionInput, mInputStreams, mIsTransaction, mNameToInput, mOpenConnection, mOutput, mStatement, RESULT_STREAM, SQL_PARAMETERS, STORED_PROCEDURE, WEB_ROW_SET_STREAM |
| Fields inherited from class uk.org.ogsadai.engine.Activity |
mContext, mExternalInputs, mExternalOutputs, mInternalInputs, mInternalOutputs |
| Constructor Summary | |
SQLStoredProcedureActivity(org.w3c.dom.Element element)
Constructor |
|
| Method Summary | |
void |
cleanUp()
This method is called once this object is no longer required It is needed because it is unclear when a PreparedStatement is no longer required So we tidy up the PreparedStatement and return any connections |
protected void |
endProcessing()
This method will complete the processing and tidy up |
protected java.lang.String |
getExpressionString()
|
protected boolean |
getResult()
This method will try and complete the statement with parameters Then try and execute the query and obtain the resultSet |
void |
processBlock()
This method will return the next block of output on the outputStream No Exceptions are thrown since they will be flagged as a status flag with the activity and the output stream will be closed On error endProcessing is called and ERROR status is set. |
protected void |
processFirst()
This method will start processing. |
| Methods inherited from class uk.org.ogsadai.activity.sql.SQLActivity |
initialise, loadNextExpression, parseCommand, parseResultStream, parseSQLParameters, prepareStatement, setupInputStreamNames |
| Methods inherited from class uk.org.ogsadai.engine.Activity |
connectsTo, getActivityConfiguration, getName, getObservableStatus, getProperties, getStatus, hasActivityConfiguration, hasProperties, setCompleted, setError |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected boolean mIsQuery
protected int mUpdateCount
protected ResultSetToWebRowSetXMLStream mRowset
| Constructor Detail |
public SQLStoredProcedureActivity(org.w3c.dom.Element element)
throws ActivityUserException,
ActivitySystemException
element - Element containing Statement conforming to schema for a SQLQueryStatement.
It is assumed schema checks have been carried out.
ActivityUserException
ActivitySystemException| Method Detail |
protected java.lang.String getExpressionString()
throws java.sql.SQLException
java.sql.SQLExceptionprotected void processFirst()
processFirst in class Activity
protected boolean getResult()
throws java.sql.SQLException,
ActivitySystemException,
ActivityUserException
getResult in class SQLActivityActivityUserException
ActivitySystemException
java.sql.SQLException
protected void endProcessing()
throws java.sql.SQLException,
ActivitySystemException
endProcessing in class SQLActivityjava.sql.SQLException
ActivitySystemExceptionpublic void processBlock()
processBlock in class Activitypublic void cleanUp()
cleanUp in class Activity
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||