title: Mule JDBC combine result set
body: <p>I have a JDBC connector as an inbound endpoint fetching the correct result set in my database.<br>
  I've noticed that each row is returned as a new message. 
  <br>
  <strong>My question:</strong> How do I combine all rows into one message? Is the aggregator the only option?
  <br>
  using Mule version 3.3.1 CE
  <br></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;mule xmlns:jersey="http://www.mulesoft.org/schema/mule/jersey"
  xmlns:http="http://www.mulesoft.org/schema/mule/http"
  xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
  xmlns:spring="http://www.springframework.org/schema/beans" xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
  xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:mongo="http://www.mulesoft.org/schema/mule/mongo"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:context="http://www.springframework.org/schema/context"
  xsi:schemaLocation="
  http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd 
  http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/current/mule-jdbc.xsd 
  http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd 
  http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd 
  http://www.mulesoft.org/schema/mule/jersey http://www.mulesoft.org/schema/mule/jersey/current/mule-jersey.xsd "    version="CE-3.3.1"&gt;
  
  
  
  
  &lt;context:property-placeholder location="configuration.properties" /&gt;
  &lt;spring:beans&gt;
      &lt;spring:bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
          &lt;spring:property name="driverClassName" value="mydriver"/&gt;
          &lt;spring:property name="url" value="${jdbc.url}"/&gt;
          &lt;spring:property name="username" value="${jdbc.user}"/&gt;
          &lt;spring:property name="password" value="${jdbc.password}"/&gt;
      &lt;/spring:bean&gt;
  &lt;/spring:beans&gt;
  
  &lt;jdbc:connector name="AS400" dataSource-ref="dataSource"
      validateConnections="true" 
      queryTimeout="-1" 
      pollingFrequency="5000"
      transactionPerMessage="false"
      doc:name="Database"&gt;
      &lt;jdbc:query key="selectNums" value="select someColumns from someTable"/&gt;
  
  &lt;/jdbc:connector&gt;
  
  
  &lt;flow name="databaseFlow" doc:name="databaseFlow" processingStrategy="synchronous"&gt;
  
  
      &lt;jdbc:inbound-endpoint 
  
          queryKey="selectNums" queryTimeout="-1" connector-ref="AS400"
          doc:name="select-record" pollingFrequency="45000"&gt;
      &lt;/jdbc:inbound-endpoint&gt;
  
  
      &lt;logger message="msg to send:  #[map-payload:col1]" level="INFO" doc:name="Logger" /&gt;
      &lt;logger message="phone number: #[map-payload:col2]" level="INFO" doc:name="Logger" /&gt;
  
  
      &lt;custom-transformer class="myTransformer" doc:name="Java"/&gt;
  
  &lt;/flow&gt;
  </code></pre>
  
  <p></p>