This documentation is for WSO2 Enterprise Integrator version 6.1.0 . View documentation for the latest release in the 6.x.x family and the latest release in the 7.x.x family.

All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. You can find the databaseSequence.xml file in the attached sample.zip archive. It is located in the <SAMPLE_HOME>/conf/synapse-config/sequences directory.

    The XML code of the database sequence is as follows.

    Code Block
    <sequence xmlns="http://ws.apache.org/ns/synapse" name="databaseSequence">
        <log level="full">
            <property name="sequence" value="before-smooks"/>
        </log>
        <smooks config-key="smooks">
            <input type="text"/>
            <output type="xml"/>	
        </smooks>
        <log level="full">
            <property name="sequence" value="after-smooks"/>
        </log>
        <iterate xmlns:ns2="http://org.apache.synapse/xsd"
                 xmlns:ns="http://org.apache.synapse/xsd"
                 xmlns:sec="http://secservice.samples.esb.wso2.org"
                 expression="//csv-records/csv-record">
          <target>
           <sequence>
            <dbreport>
              <connection>
               <pool>
                 <password>db-password</password>
                 <user>db-username</user>
                 <url>jdbc:mysql://localhost:3306/test</url>
                 <driver>com.mysql.jdbc.Driver</driver>
               </pool>
              </connection>
               <statement>
                <sql>insert into userdetailsinfo values (?, ?, ?, ?, ?)</sql>
                  <parameter expression="//csv-record/name/text()" type="VARCHAR"/>
                  <parameter expression="//csv-record/surname/text()" type="VARCHAR"/>
                  <parameter expression="//csv-record/phone/text()" type="VARCHAR"/>
                </statement>
            </dbreport>
          </sequence>
        </target>
      </iterate>
    </sequence>
    
  2. Specify your database username, password, and URL in the <pool> section of the sequence.
  3. Save the databaseSequence.xml file to the <ESB_HOME>/repository/deployment/server/synapse-configs/default/sequences directory.

...