Activity - sqlQueryStatement

Activity Type: Relational

Description

Run an SQL query on a relational data resource. Note that output from this activity must be converted into a string representation, e.g. using the SQLResultsToXML activity, before it can be delivered in the response or to an output stream.

Example

<sqlQueryStatement name="statement">
  <!-- value of first parameter -->
  <sqlParameter position="1" from="idvalue"/>
  <!-- value of second parameter -->
  <sqlParameter position="2">321</sqlParameter>
  <expression>
    select * from littleblackbook where id <= ? and id >= ?
  </expression>
  <resultStream name="statementResponse"/>
</sqlQueryStatement>

Specification

Element sqlQueryStatement:

Warning to Service Deployers

Note that providing an SQL update statement will cause an exception to be thrown. If the database driver used by OGSA-DAI to communicate with the database supports read-only connections then the database will not be modified. If however, the driver does not support read-only connections then the database will be modified.

Data Resource Accessor

This activity requires a data resource accessor that implements the following interface: uk.org.ogsadai.dataresource.JDBCConnectionProvider

Input and Output Types

XML Schema

OGSA-DAI/schema/ogsadai/xsd/activities/sql_query_statement.xsd

Class

uk.org.ogsadai.activity.sql.SQLQueryStatementActivity

Client Toolkit Class

uk.org.ogsadai.client.toolkit.activity.sql.SQLQuery