title: Spring boot ( spring batch) configuration disable the automatic creation of the database
body: <p>I am using Spring-boot with Spring-Batch, I have  datasource config in my application.properties, but i don't want spring batch to create tables in my database, so for that I use the following configuration  </p>
  
  <pre><code>@Configuration
  @EnableBatchProcessing
  public class BatchConfiguration {
  
  @Autowired
  public JobBuilderFactory jobBuilderFactory;
  
  @Autowired
  public StepBuilderFactory stepBuilderFactory;
  
  @Bean
  public Job myJob() {
      return jobBuilderFactory.get("myJob").incrementer(new RunIdIncrementer())
              .listener(listener()).flow(step2()).end().build();
  }
  
  @Bean
  public JobRegistryBeanPostProcessor jobRegistryBeanPostProcessor(final JobRegistry jobRegistry) {
      JobRegistryBeanPostProcessor jobRegistryBeanPostProcessor = new JobRegistryBeanPostProcessor();
      jobRegistryBeanPostProcessor.setJobRegistry(jobRegistry);
      return jobRegistryBeanPostProcessor;
  }
  
  @Bean
  public Step step2() {
      LOGGER.info("step2");
      return stepBuilderFactory.get("step2").tasklet(new PurchaseStatusBatch()).build();
  }
  
  @Bean
  public JobOperator jobOperator() throws Exception {
      SimpleJobOperator jobOperator = new SimpleJobOperator();
      jobOperator.setJobExplorer(jobExplorer());
      jobOperator.setJobLauncher(jobLauncher());
      jobOperator.setJobRegistry(jobRegistry());
      jobOperator.setJobRepository(getJobRepo());
      return jobOperator;
  }
  
  @Bean
  public JobRegistry jobRegistry() {
      return new MapJobRegistry();
  }
  
  @Bean
  public JobExplorer jobExplorer() throws Exception {
  
      MapJobExplorerFactoryBean factoryExplorer = new MapJobExplorerFactoryBean(
              new MapJobRepositoryFactoryBean(getTransactionManager()));
      factoryExplorer.afterPropertiesSet();
      return factoryExplorer.getObject();
  }
  
  @Bean
  public JobLauncher jobLauncher() throws Exception {
      SimpleJobLauncher jobLauncher = new SimpleJobLauncher();
      jobLauncher.setJobRepository(getJobRepo());
      jobLauncher.afterPropertiesSet();
      return jobLauncher;
  }
  
  @Bean
  public PlatformTransactionManager getTransactionManager() {
      return new ResourcelessTransactionManager();
  }
  
  @Bean
  public JobRepository getJobRepo() throws Exception {
      return new MapJobRepositoryFactoryBean(getTransactionManager()).getObject();
  }
  }
  </code></pre>
  
  <p>I use <code>spring.batch.initializer.enabled=false</code> to disable the automatic creation of the database tables</p>
  
  <p>During first run of the application, everything works fine but when i try to lanch my job I get MySQLSyntaxErrorException : </p>
  
  <blockquote>
    <p>com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table
    'BATCH_JOB_INSTANCE' doesn't exist</p>
  </blockquote>