我已经在XML文件中编写了如下查询&想要从java代码中为created_date传递动态值,我正在创建spring批处理程序。那么该怎么做呢?如何在Spring中将动态变量传递给XML批处理
<property name="dataSource" ref="dataSource" />
<property name="sql"
value="SELECT `txn`.`id`,
`txn`.`sender_id`,
`txn`.`beneficiary_id`,
`txn`.`amount`,
`txn`.`pay_mode_master_id`,
`txn`.`status`,
`txn`.`reference_number`,
`txn`.`created_by`,
`txn`.`created_date`,
`txn`.`updated_by`,
`txn`.`updated_date`,
`txn`.`source_currency_master_id`,
`txn`.`dest_currency_master_id`,
`txn`.`fees`,
`txn`.`exchange_rate`,
`txn`.`total_amount`,
`txn`.`recipient_gets`,
`txn`.`from_country`,
`txn`.`to_country`,
`txn`.`other_purpose`,
`txn`.`transaction_purpose_id`,
`txn`.`sender_account_id`,
`txn`.`transaction_number`,
`txn`.`source_region`,
`txn`.`error`,
`txn`.`corridor_id`,
`txn`.`promo_code`,
`txn`.`receiver_id`,
`txn`.`error_code`
FROM `remittance`.`transaction_master` txn where txn.created_date >= '2017-02-09 00:00:00' AND txn.created_date <='2017-02-09 23:59:59';" />
<property name="rowMapper">
<bean class="com.websystique.springbatch.ExamResultRowMapper" />
</property>
</bean>
但我想把整个查询放在XML中,但参数应该从java代码中动态传递,并且希望将该查询用于spring批处理作业。 – nIKHIL