${sql()}
Executes the specified SQL statement and returns the result.
| 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 | descendant-or-self::text() | The SQL expression to evaluate. | PHRASE | java.lang.String | Yes |
Loads a Spring bean container defined in 'datasourceContext.xml' which contains a DataSource, then begins a transaction, then queries that DataSource for the 'user_id' associated with the 'admin' account, then performs an 'upsert' operation on the 'up_user_profile' table:
UPDATE up_user_profile SET profile_name = 'HTML browser profile' WHERE user_id = ?
INSERT INTO up_user_profile(user_id, profile_id, profile_name, description, layout_id, structure_ss_id, theme_ss_id) VALUES(?, 1, 'HTML browser profile', 'A sample profile for common web browsers', 1, 1 1)