|
|||||||||||
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.SQLQueryStatementActivity
Executes one or a sequence of SQL query statements across a JDBC
connection. The activity outputs java.sql.ResultSet
s.
The SQLQueryStatementActivity is constructed from an
Element
corresponding to a statement for execution on
a database.
The credentials of the user should be available to obtain a
connection from the JDBCConnectionProvider
.
The activity is then processed a block at a time. On the request
for the first block the activity will obtain a connection from the
JDBCConnectionProvider
. Subsequent calls execute the
statement on the database and put the resulting
ResultSet
object into the output stream.
When there are no more results, the connection is returned to the
JDBCConnectionProvider
.
Note:
Database needs to support java.sql.Connection.setReadOnly
otherwise update could slip through, be committed and only then
flag an error Extend this class if the database driver does not
support all of the methods and flags used here.
A prepared statement will automatically be used if
sqlParameter
s are specified. Parameter valuescan be
pulled from an output stream of another activity or may be provided
by value in the request.
OGSA-DAI/doc/interaction/activities/relational/sqlQueryStatement.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 |
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 | |
SQLQueryStatementActivity(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 |
private static final java.lang.String COPYRIGHT_NOTICE
private static DAILogger LOG
private java.sql.Connection mConnection
Constructor Detail |
public SQLQueryStatementActivity(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
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |