0
votes

*I want to configure two different databases in spring admin batch job. But while running the application only "POSTGRES" database is getting configure. Is it possible to configure 2 diff DB for the spring batch application. I have added properties for both DB. It is getting configured and running the application. But when i tried to fetch the data from different DB(secondary). So it is not able to map the tables

batch.jdbc.url=jdbc:postgresql://localhost:5432/glow
batch.jdbc.driver=org.postgresql.Driver
batch.jdbc.user=postgres
batch.jdbc.password=postgres
travel.batch.jdbc.driver=com.mysql.jdbc.Driver
travel.batch.jdbc.url=jdbc:mysql://localhost:3306/travel
travel.batch.jdbc.user=root
travel.batch.jdbc.password=root

I want to configure and connect to both database fetch the data from both DB for different batch job in spring admin batch job project*

1
What error do you get ? - Arnaud Claudel
Not able two map tables of secondary database, but i am not getting error while configuring the second database Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'glow.pod_notification' doesn't exist - jinit bansod
Can you see the table in an admin view or something like that ? Are you sure that it exists ? - Arnaud Claudel
I did'nt get by admin view, the table exist in another "TRAVEL" database, And only by default batch.jdbc.url=jdbc:postgresql://localhost:5432/glow batch.jdbc.driver=org.postgresql.Driver batch.jdbc.user=postgres batch.jdbc.password=postgres the above properties are getting enabled as it is starting by "batch.jdbc..." - jinit bansod
@ArnaudClaudel Is it possible to use two database for spring batch admin ?? - jinit bansod

1 Answers

0
votes

In spring batch application two database are not configured at a time only 1db can connect, though it can multiple properties to connect to database at a time only one can connect and it is verified. In spring boot application it is possible to connect multiple database at a time but not in spring batch.