JDBC result set to XML transformer
Payload transformer that converts results sets created by the JDBC adapters to XML.
Transformer that converts results sets created by the JDBC adapters to XML.
The result of this transformation will be a complete, well-formed XML document as a String (the default), XOM document or DOM document. The layout of this document is defined by the XML schema located at:
classpath:com/emagiz/components/jdbc/emagiz-jdbc-1.0.xsd
Example
The result of this SQL query (PosgreSQL):
SELECT id, active, lastlogin AT TIME ZONE 'UTC' AS lastlogin FROM system$user
Results in this XML message:
<?xml version="1.0"?> <jdbc:result-set xmlns:jdbc="http://www.emagiz.com/ns/jdbc/1.0/"> <jdbc:row> <jdbc:column name="id" value="2"/> <jdbc:column name="active" value="true"/> <jdbc:column name="lastlogin" value="2011-09-28T16:24:26.709+02:00"/> </jdbc:row> <jdbc:row> <jdbc:column name="id" value="4"/> <jdbc:column name="active" value="false"/> <jdbc:column name="lastlogin" value="2011-10-03T14:35:01.447+02:00"/> </jdbc:row> </jdbc:result-set>
Output format
Determines the output format of the transformation.
Usually auto
(the default) works fine, but in some cases this can lead to unexpected output. For example, when a JDBC gateway is configured to return a single row, each column in this row will be converted to a separate result set. By using rows
this can be prevented, but you'll have to be certain that the result can never actually contain multiple result sets.
Default is auto
.
Result type
Sets the result type (XomDocument
, DomDocument
or String
) for the transformation.
Default is String
.
Output channel
Channel where output messages should be sent after (successfully) processing the input message.
You can select the nullChannel
here to silently drop the output messages.
Required
Input channel
Channel to consume the input messages from.
Required
Id
Name that uniquely identifies this flow component.
Required