0

I am very new to spring, Consider a situation where two databases are being used in a spring app and they are configured (one is MySql and the other is PostGre), one service uses a table in MySql and other service uses a table in PostGre, now I want to know how do I provide them the required database connection during runtime?

Any help is appreciated. TIA

sumanth kumar
  • 21
  • 1
  • 4

1 Answers1

2

This answer explains how to configure two data sources for a single Spring Boot application.

Also, this tutorial explains the same concept with a detailed example.

The copying procedure could be done by fetching all the objects from each table on the main DB, deleting id values, and saving them to the second DB.

gsan
  • 549
  • 1
  • 4
  • 14