Dashboard > Mule FAQ - Open Source ESB and Integration Platform > ... > Frequently Asked Questions (FAQ) > How to resolve the error message - Write statement should be an insert , update , delete sql statement (java.lang.IllegalArgumentException)
  Mule FAQ - Open Source ESB and Integration Platform Log In | Sign Up   View a printable version of the current page.  
  How to resolve the error message - Write statement should be an insert , update , delete sql statement (java.lang.IllegalArgumentException)

Added by Kynan Fraser , last edited by Kynan Fraser on Jun 19, 2007  (view change)
Labels: 
(None)

Error message: Write statement should be an insert / update / delete sql statement (java.lang.IllegalArgumentException)

You need to execute 'select' SQL statements in the inbound router endpoints and 'insert, update and delete' statements in the outbound router endpoints.

More specifically this error means you have tried to execute a 'select' statement in an outbound endpoint, move it to the inbound endpoint.

eg.

<connector name="jdbcConnector" className="org.mule.providers.jdbc.JdbcConnector">
	<properties>
		<container-property name="dataSource" reference="muleJdbcDatasource" required="true" />
			<property name="pollingFrequency" value="10000" />
			<map name="queries">
				<property name="setData"
					value="insert into customer values ('mule_last', 'mule_first', 'mule_address', 'mule.com');" />
				<property name="getData"
					value="select * from customer;" />
			</map>
	</properties>
</connector>

<inbound-router>	
	<endpoint address="jdbc://getData" connector="jdbcConnector">						
	</endpoint>	
</inbound-router>
			
<outbound-router>									
	<router className="org.mule.routing.outbound.OutboundPassThroughRouter">	
               <endpoint address="jdbc://setData" connector="jdbcConnector"/>
	</router>				
</outbound-router>
Copyright(c) CustomWare Asia Pacific Pty Ltd
Powered by Atlassian Confluence 2.7.3, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators