|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.client.toolkit.activity.RequestComponent | +--uk.org.ogsadai.client.toolkit.activity.Activity | +--uk.org.ogsadai.client.toolkit.activity.ParameterizedActivity | +--uk.org.ogsadai.client.toolkit.activity.sql.SQLQuery
This activity evaluates an SQL statement that generates a single
java.sql.ResultSet
.
The activity has no inputs and one outputs - the
ResultSet
.
The format output can only be streamed to other activities. For
delivery in the response the output from this activity should be
connected as an input to the WebRowSet
activity which
will convert the ResultSet
into an XML WebRowSet
representation of the ResultSet
.
Queries can be parameterized by using the ?
token in
the query expression. These tokens can be replaced with parameter
values hence allowing an activity to be reused with a slightly
different configuration.
For example, the activity may have the following query
expression:SELECT * FROM MyTable WHERE id > ? AND id
< ?
This query has two parameters whose values can be
set using the setParameter
method, for example:
myActivity.setParameter( 1, "10" );
myActivity.setParameter( 2, "20" );
Would be equivalent to the query expression:
SELECT * FROM MyTable WHERE id > 10 AND id < 20
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE
Copyright statement |
private java.lang.String |
mQuery
SQL query |
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.ParameterizedActivity |
|
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.Activity |
|
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent |
|
Constructor Summary | |
SQLQuery(java.lang.String expression)
Constructs a query with the given query expression. |
Method Summary | |
protected java.lang.String |
generateXML()
Generates the XML representing the activity. |
java.lang.String |
getExpression()
Gets the SQL query expression. |
ActivityOutput |
getOutput()
Gets the activity's only output. |
void |
setExpression(java.lang.String expression)
Sets the SQL expression. |
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.ParameterizedActivity |
clearParameters, generateParametersXML, setParameter, setParameter |
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.Activity |
addInput, addOutput, addOutputs, getDataResourceID, getInputParameters, getOutputParameters, getOutputs, replaceSpecialCharacters, setDataResourceID, setInput |
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent |
getDataService, getName, getSession, setDataService, setSession |
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 java.lang.String mQuery
Constructor Detail |
public SQLQuery(java.lang.String expression)
expression
- SQL query.
java.lang.IllegalArgumentException
- If expression
is null
.Method Detail |
public void setExpression(java.lang.String expression)
expression
- SQL query.
java.lang.IllegalArgumentException
- If expression
is null
.public java.lang.String getExpression()
public ActivityOutput getOutput()
protected java.lang.String generateXML()
RequestComponent
generateXML
in class Activity
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |