【发布时间】:2017-02-23 13:02:43
【问题描述】:
我在 XML 文件中编写了以下查询并希望从 java 代码传递 created_date 的动态值,我正在创建 spring 批处理程序。那么该怎么做呢?
<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>
【问题讨论】:
标签: java xml xml-parsing spring-batch