Dynamic SQL in JdbcCursorItemReader
Hello all
i was wondering if i can build, for my jdbcCursorItemReader, a sql like this .
Assuming i defined in my jobParameters a parameter name
Code:
<bean id="itemReader" scope="step"
class="org.springframework.batch.item.database.JdbcCursorItemReader">
<beans:property name="dataSource" ref="appDataSource" />
<beans:property name="rowMapper">
<beans:bean
class="org.springframework.jdbc.core.ColumnMapRowMapper" />
</beans:property>
<property name="sql" value="select * from #{jobParameters['tableName']}"/>
....
</bean>
reason of that is that i have to configure potentially multiple jobs which export data from database tables, and all of them
will have to do a select * from <tablename>
I know i could put the whole sql as JobParameter, but all the sql will be select * from <tablename>
has anyone a better suggestion?
w/kindest regards
marco