I use spring batch in a spring boot application (2.5.3).
In my properties I put theses two line to avoid to create db tables
spring.batch.jdbc.initialize-schema=never
spring.batch.initialize-schema=never
In my Config class, I have
@Bean
public Job lastConsentBatchJob() {
return this.jobBuilderFactory.get("lastBatchJob")
.incrementer(new RunIdIncrementer())
.flow(lastConsentBatchStep())
.end()
.build();
}
@Bean
public Step lastConsentBatchStep() {
return this.stepBuilderFactory.get("lastBatchJob").<LastDto, LastDto>chunk(1)
.reader(reader())
.writer(writer(null)).build();
}
Why when I lunch application, spring launch this query
SELECT JOB_INSTANCE_ID, JOB_NAME from BATCH_JOB_INSTANCE where JOB_NAME = ? and JOB_KEY = ?