provider
DB Provider — Provides SQL query results from a database<provider class="xms.template.provider.DBProvider" … > child tags </provider>
Table 39. Attributes for provider tag (for xms.template.provider.DBProvider)
| Name | Description | Type | Default Value | Required |
|---|---|---|---|---|
| columnMap | Maps template variables to SQL result columns | Map Comma separated list of variable=column pairs | none | no |
| dataSource | The DataSource to direct queries to | Template Freemarker template string | none | yes |
| fetchSize | Number of row to retrieve at a time from the database | int any integer | 0 (Use database default) | no |
| isStoredProc | Is this a stored procedure? | boolean true or false | false | no |
| name | Sets a name for this provider for reference | String any character combination | DB Provider | no |
| onEmpty | Sets the behavior when this query returns no results | OnEmpty One of the following values: stop,fail,continue | stop | no |
| streamResults | Stream results directly from database | boolean true or false | true | no |
| subList | If set, assigns the entire results of this query to the specified variable | String any character combination | none | no |
| timeout | Timeout in ms for query | int any integer | 0 (no timeout) | no |
This tag depends on the following services (or a service that extends or implements these classes)
Example 44. Example configuration for DB Provider
Required attributes are marked with a bold typeface
<provider class="xms.template.provider.DBProvider"
columnMap="columnMap"
dataSource="dataSource"
fetchSize="fetchSize"
isStoredProc="isStoredProc"
name="name"
onEmpty="onEmpty"
streamResults="streamResults"
subList="subList"
timeout="timeout">
<sql>
value
</sql>
<commitpoint>
<action class="class" … />
</commitpoint>
<param>
value
</param>
</provider>