<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:int="http://www.springframework.org/schema/integration"
	xmlns:int-jdbc="http://www.springframework.org/schema/integration/jdbc"
	xsi:schemaLocation="http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
		http://www.springframework.org/schema/integration/jdbc https://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd
		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">

	<import resource="classpath:derby-stored-procedures-setup-context.xml"/>

	<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
		<constructor-arg ref="dataSource" />
	</bean>

	<int:chain input-channel="jdbcStoredProcOutboundChannelAdapterWithinChain">
		<int-jdbc:stored-proc-outbound-channel-adapter stored-procedure-name="CREATE_USER" data-source="dataSource">
			<int-jdbc:parameter name="username" expression="payload.username"/>
			<int-jdbc:parameter name="password" expression="payload.password"/>
			<int-jdbc:parameter name="email" expression="payload.email"/>
		</int-jdbc:stored-proc-outbound-channel-adapter>
	</int:chain>

</beans>
