我正在学习 spring Batch 抛出一个简单的例子,我从数据库中读取数据并将其写入 xml 文件。作业运行正常,但我看不到我放在 ItemReadListener 中的消息。我在配置中遗漏了什么吗?谢谢你的帮助。我会放最相关的代码,如果需要我可以添加更多。
工作.xml :
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:batch="http://www.springframework.org/schema/batch"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.springframework.org/schema/jdbc">
<bean id="itemReader" class="org.springframework.batch.item.database.JdbcPagingItemReader" scope="step">
<property name="dataSource" ref="dataSource"/>
<property name="queryProvider">
<bean class="org.springframework.batch.item.database.support.SqlPagingQueryProviderFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="selectClause" value="SELECT internal_Id,individual_Id "></property>
<property name="fromClause" value="FROM Person"></property>
<property name="whereClause" value="where internal_Id < :idMax"></property>
<property name="sortKey" value="internal_Id"></property>
</bean>
</property>
<property name="parameterValues">
<map>
<entry key="idMax" value="#{jobParameters['idMax']}"></entry>
</map>
</property>
<property name="pageSize" value="10"></property>
<property name="rowMapper">
<bean class="sb.dbToxml.PersonRowMapper"></bean>
</property>
</bean>
MM们
相关分类