title: How to read SQL queries from properties file in Mule 3.5 Database connector
body: <p>I have a Mule flow which is fetching Data from Database using Mule 3.5 Database connector ... My Mule Flow is following :-</p>
  
  <pre><code>&lt;flow name="BestelItems" doc:name="BestelItems"&gt;
   &lt;poll doc:name="Poll"&gt;
   &lt;fixed-frequency-scheduler frequency="30" timeUnit="SECONDS"/&gt;
    &lt;db:select config-ref="Generic_Database_Configuration" doc:name="Database"&gt;
       &lt;db:parameterized-query&gt;&lt;![CDATA[select * from getData]]&gt;&lt;/db:parameterized-query&gt;
   &lt;/db:select&gt;
    &lt;/poll&gt;
  &lt;mulexml:object-to-xml-transformer doc:name="Object to XML"/&gt;
  &lt;logger message="Payload :- #[message.payload]" level="INFO" doc:name="Logger" /&gt;
  &lt;/flow&gt;
  </code></pre>
  
  <p>Now this works fine and fetch all the Data from DB and display in console using logger ..</p>
  
  <p>Now the issue is, if I try to read the query from a property file then it throws an exception ... for example if I put the SQL query <code>select * from getData</code> in a Property file like the following :- <code>QueryFromPropertyfile= select * from getData</code>  and then try to read the value in the flow like :-</p>
  
  <pre><code> &lt;db:select config-ref="Generic_Database_Configuration" doc:name="Database"&gt;
     &lt;db:parameterized-query&gt;&lt;![CDATA[${QueryFromPropertyfile}]]&gt;&lt;/db:parameterized-query&gt;
   &lt;/db:select&gt;
  </code></pre>
  
  <p>Then it generate the following exception :-</p>
  
  <pre><code>ERROR 2014-08-02 22:39:51,064 [pool-14-thread-1] org.mule.exception.DefaultSystemExceptionStrategy: Caught exception in Exception Strategy: Query type must me '[SELECT, STORE_PROCEDURE_CALL]' but was 'DDL'
  java.lang.IllegalArgumentException: Query type must me '[SELECT, STORE_PROCEDURE_CALL]' but was 'DDL'
      at org.mule.module.db.internal.processor.AbstractDbMessageProcessor.validateQueryType(AbstractDbMessageProcessor.java:164)
      at org.mule.module.db.internal.processor.AbstractSingleQueryDbMessageProcessor.executeQuery(AbstractSingleQueryDbMessageProcessor.java:40)
      at org.mule.module.db.internal.processor.AbstractDbMessageProcessor.process(AbstractDbMessageProcessor.java:66)
      at org.mule.transport.polling.MessageProcessorPollingMessageReceiver$1.process(MessageProcessorPollingMessageReceiver.java:164)
      at org.mule.transport.polling.MessageProcessorPollingMessageReceiver$1.process(MessageProcessorPollingMessageReceiver.java:148)
      at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16)
      at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30)
      at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14)
      at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:54)
      at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44)
      at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50)
      at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40)
      at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41)
      at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48)
      at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28)
      at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13)
      at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:109)
      at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:30)
      at org.mule.transport.polling.MessageProcessorPollingMessageReceiver.pollWith(MessageProcessorPollingMessageReceiver.java:147)
      at org.mule.transport.polling.MessageProcessorPollingMessageReceiver.poll(MessageProcessorPollingMessageReceiver.java:138)
      at org.mule.transport.AbstractPollingMessageReceiver.performPoll(AbstractPollingMessageReceiver.java:216)
      at org.mule.transport.PollingReceiverWorker.poll(PollingReceiverWorker.java:80)
      at org.mule.transport.PollingReceiverWorker.run(PollingReceiverWorker.java:49)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:724)
  ERROR 2014-08-02 22:40:20,667 [pool-14-thread-1] org.mule.exception.DefaultSystemExceptionStrategy: Caught exception in Exception Strategy: Query type must me '[SELECT, STORE_PROCEDURE_CALL]' but was 'DDL'
  java.lang.IllegalArgumentException: Query type must me '[SELECT, STORE_PROCEDURE_CALL]' but was 'DDL'
      at org.mule.module.db.internal.processor.AbstractDbMessageProcessor.validateQueryType(AbstractDbMessageProcessor.java:164)
      at org.mule.module.db.internal.processor.AbstractSingleQueryDbMessageProcessor.executeQuery(AbstractSingleQueryDbMessageProcessor.java:40)
      at org.mule.module.db.internal.processor.AbstractDbMessageProcessor.process(AbstractDbMessageProcessor.java:66)
      at org.mule.transport.polling.MessageProcessorPollingMessageReceiver$1.process(MessageProcessorPollingMessageReceiver.java:164)
      at org.mule.transport.polling.MessageProcessorPollingMessageReceiver$1.process(MessageProcessorPollingMessageReceiver.java:148)
      at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16)
      at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30)
      at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14)
      at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:54)
      at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44)
  </code></pre>
  
  <p>Please help .. what should I need to do to read SQL queries from properties file in the new Mule 3.5 Database connector .. I have searched all through the net .. but couldn't able to find solution ...</p>