Results 1 to 3 of 3

Thread: JDBCItemReader whitn where clause

  1. #1

    Default 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. #2
    Join Date
    Feb 2008
    Posts
    488

    Default

    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">
    ...

  3. #3

    Default

    Thank you very much!!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •