Cernunnos Manual


<sql-statement>

Description:

Executes the specified SQL statement. By default, this task looks for a Connection object as a request attribute under the name OpenConnectionTask.DEFAULT_ATTRIBUTE_NAME.

Reagents:

Name XPath Description Reagent Type Expected Type Required
DATA_SOURCE @data-source The DataSource to use for executing the SQL. If omitted the request attribute under the name 'SqlAttributes.DATA_SOURCE' will be used PHRASE javax.sql.DataSource No
CONNECTION @connection **DEPRECATED: Use DATA_SOURCE instead.** Optional Connection object. The default is the value of the 'SqlAttributes.CONNECTION' request attribute (if specified) or null. PHRASE java.sql.Connection No
SQL @sql The SQL statement that will be executed. PHRASE java.lang.String Yes
PARAMETERS parameter/@value The parameters (if any) for the PreparedStatement that will execute the SQL. NODE_LIST java.util.List No

Examples:

Connects to a database using the password stored in '/C:/passwd.txt', executes the SQL statement specified by the first argument on the command line:

 
       
        <sql-datasource driver="org.hsqldb.jdbcDriver" password="${url(/C:/passwd.txt)}" url="jdbc:hsqldb:hsql://localhost:8887" username="sa"> 
          <sql-statement sql="${req($1)}"/> 
        </sql-datasource>