3
votes

I am using spring batch to parse my files. I want to use spring Batch Admin for job inspection, job launching, job execution. Spring Batch Admin uses HSQLDB database, which is initialized on start up. My spring batch project uses its own database which includes the appropriate tables for spring batch:

  1. BATCH_JOB_INSTANCE
  2. BATCH_JOB_PARAMS
  3. BATCH_JOB_EXECUTION
  4. BATCH_STEP_EXECUTION
  5. BATCH_JOB_EXECUTION_CONTEXT
  6. BATCH_STEP_EXECUTION_CONTEXT
  7. BATCH_STEP_EXECUTION_SEQ
  8. BATCH_JOB_EXECUTION_SEQ
  9. BATCH_JOB_SEQ

In my database also are included some else tables which are used from my project.

I want Spring Batch Admin to use the upper tables of my database instead of its own database. Is there any way to do that?

2

2 Answers

2
votes

Looks like I am late in responding but still, in case somebody still looks for an answer to this. Yes, to make Spring Batch Admin use the same database, place your datasource configuration properties under src/main/resources/META-INF/default-properties. Also, to make it load your context, a context configuration file needs to be placed under src/main/resources/META-INF/spring/batch/servlet/override/. Placing of files to override those that come by default with Spring Batch Admin is important as it looks for files in a certain hierarchy. The following article could also be looked into to have a working example. http://examples.javacodegeeks.com/enterprise-java/spring/spring-batch-admin-tutorial/

1
votes

You need to read the repositoryTablePrefix section of the spring-batch documentation.