How to call a stored procedure from a Spring Batch Tasklet?
10:03 07 Jun 2015

It is mentioned that a TaskletStep in Spring Batch can be used to call a stored procedure. Could anyone provide an example of how to invoke a Stored Procedure from a TaskletStep? So far I have done this but it throws an exception saying "Configuration problem: The element [callStoredProcedure] is unreachable"

       
          
                
          
       

       
             
             
       

Java Class

        class MyClass implements Tasklet{
               @Override
               public RepeatStatus execute(StepContribution contribution,
        ChunkContext chunkContext) throws Exception {
                  JdbcTemplate myJDBC=new JdbcTemplate(getDataSource());
                  myJDBC.execute(sql);
                  return RepeatStatus.FINISHED;
             }      
        }
                

How and where should the stored procedure be configured? Would be grateful to receive any pointers?

spring spring-batch