'There are inbuilt tables created by spring batch job in H2 like job_instance etc. How can we add prefix to those tables using properties file?

I have a spring batch job up and running and tables are created in H2.Few tables are auto generated tables in spring batch like job_instance etc. How can i add a prefix to these auto generated tables using properties file in java code?

nwg.nca.sar.batch.appTablePrefix=SOCA_

Tried using this

and

spring.batch.table-prefix=SOCA_

None of them worked.

Any help appreciated. Thanks



Solution 1:[1]

Are you using Spring Boot? Then it's

spring.batch.jdbc.table-prefix

It used to be spring.batch.table-prefix up until Spring Boot 2.4.

You can find more information on all the properties in the reference documentation: https://docs.spring.io/spring-boot/docs/2.6.4/reference/html/application-properties.html#application-properties.integration.spring.batch.jdbc.table-prefix

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Henning