0

I have a spring boot batch application. In application.properties, I specify my data source details as follows

spring.datasource.url=jdbc:jtds:sqlserver://1*.2**.6*.25:14**
spring.datasource.database=MYDB_DEV
spring.datasource.username=username
spring.datasource.password=password

The problem is, when I run the batch job, all user defined tables are taken from the MYDB_DEV. But Metadata tables like BATCH_JOB_EXECUTION, BATCH_JOB_EXECUTION_CONTEXT are taken from the MASTER schema even though I have created the same tables in MYDB_DEV. Why this happens? Is there any work around to make the application read Metadata tables from user defined schema?

I have debugged though the jobLauncher.run(myjob, jobParameters), Could not find any lead from where it is taking master Schema

Chetan Joshi
  • 5,582
  • 4
  • 30
  • 43
User_1940878
  • 321
  • 1
  • 6
  • 25

1 Answers1

3

Use below property in application.properties or application.yml

spring.batch.tablePrefix=MYDB_DEV.BATCH_
Chetan Joshi
  • 5,582
  • 4
  • 30
  • 43
Sushil Behera
  • 817
  • 6
  • 20
  • Thanks for the reply! We have already tried this approach. Still not working. Spring boot version we are using is 1.2.5. Tried both spring.batch.tablePrefix and spring.batch.table-prefix with schema names as well. – User_1940878 May 28 '19 at 05:30