Prateek
Prateek

Reputation: 11

How can we disable the creation of meta data tables while keeping the database connection in spring boot batch?

I've data-source properties in my application.properties, but i don't want spring batch to create meta tables in my database. Do we have a way to keep the data-source but stop spring batch from creating the meta data files.

Upvotes: 1

Views: 5701

Answers (2)

cassiomolin
cassiomolin

Reputation: 130877

You can switch off the database initialization explicitly by setting spring.batch.jdbc.initialize-schema to never, as follows:

spring.batch.jdbc.initialize-schema=never
spring:
  batch:
    jdbc:
      initialize-schema: never

Upvotes: 0

Mahmoud Ben Hassine
Mahmoud Ben Hassine

Reputation: 31600

Add the following property in your application.properties file:

spring.batch.initialize-schema=never

This will prevent creating meta data tables in your data source. You can find more details on this here: https://docs.spring.io/spring-boot/docs/current/reference/html/howto.html#howto-initialize-a-spring-batch-database

Upvotes: 1

Related Questions