Announcement Announcement Module
Collapse
No announcement yet.
JDBCItemReader whitn where clause Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JDBCItemReader whitn where clause

    Hi!!

    Is it possible to configure de Jdbc itemRedader for accessing JobExecution context or stepExecution context.. Perhaps somatingh like this:

    Code:
    <bean id="Paso1_Reader"
    		class="org.springframework.batch.item.database.JdbcCursorItemReader">
    		<property name="dataSource" ref="zzzDataSource" />
    		<property name="sql" value="select * FROM USUARIOS_AUDIT where USUARIO_AUDITADO='#{stepExecutionContext[userName]}'" />
    		<property name="rowMapper">
    			<bean class="es.bde.aps.zzz.ias.batch.basedatos.Paso1_Reader_Mapper">
    				<property name="mappers">
    					<util:map>
    						<entry key="ID_APLICACION" value="idAplicacion" />
    						<entry key="USUARIO_AUDITADO" value="usuarioAuditado" />
    					</util:map>
    				</property>
    			</bean>
    		</property>
    	</bean>
    I tried it but it doesn't run...

    Any help??

  • #2
    You need to add scope="step" in order for the late-binding to be resolved:

    Code:
    <bean id="Paso1_Reader"
          class="org.springframework.batch.item.database.JdbcCursorItemReader">
          scope="step">
    ...

    Comment


    • #3
      Thank you very much!!

      Comment

      Working...
      X