I cannot correctly update the database table using JdbcBatchItemWriter. The following is a snippet of code. inserting on an empty table receives the correct answer, but the update does not occur in the input table.
<bean id="odbWriter" class="org.springframework.batch.item.database.JdbcBatchItemWriter">
<property name="dataSource" ref="dataSource"></property>
<property name="sql">
<value>
<![CDATA[
update employeethree set salary = :salary, designation = :designation, promotioneligibility = :promotionEligibility
]]>
</value>
</property>
<property name="itemSqlParameterSourceProvider">
<bean
class="batchjobreaddb.CustomBeanPropertyItemSqlParameterSourceProvider" />
</property>
If I change the request inside CDATA to:
insert into employeetwo values(:empId, :empName, :dept , :salary, :designation, :experienceInMonths, :promotionEligibility)
then he gives me the desired results. (EmployeeTwo has the same structure but is empty.)
Please, help. Thank:)
source
share