Name

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)

NameDescriptionTypeDefault ValueRequired
columnMapMaps template variables to SQL result columnsMap Comma separated list of variable=column pairsnoneno
dataSourceThe DataSource to direct queries toTemplate Freemarker template stringnoneyes
fetchSizeNumber of row to retrieve at a time from the databaseint any integer0 (Use database default)no
isStoredProcIs this a stored procedure?boolean true or falsefalseno
nameSets a name for this provider for referenceString any character combinationDB Providerno
onEmptySets the behavior when this query returns no resultsOnEmpty One of the following values: stop,fail,continuestopno
streamResultsStream results directly from databaseboolean true or falsetrueno
subListIf set, assigns the entire results of this query to the specified variableString any character combinationnoneno
timeoutTimeout in ms for queryint any integer0 (no timeout)no

Service Dependencies

This tag depends on the following services (or a service that extends or implements these classes)

Child Tags

SQL Element

<sql>value</sql>

Table 40. Attributes for sql tag (for xms.template.provider.DBProvider)

NameDescriptionTypeDefault ValueRequired
valueThe SQL query to executeTemplate Freemarker template stringnoneyes

Commit Point

<commitpoint> child tags </commitpoint>

[Note]Note
There are no attributes for this tag
Child Tags
Action

<action class="class" />

Classes Implementing xms.action.Action

The following classes can be used in the class attribute for this tag:

Param Element

<param>value</param>

Table 41. Attributes for param tag (for xms.template.provider.DBProvider)

NameDescriptionTypeDefault ValueRequired
valueAn SQL query parameterTemplate Freemarker template stringnoneyes

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>