Tisha
Tisha

Reputation: 857

Can you connect to two postgres databases in Springboot?

If yes, how?

I am writing a archival project where old data from one database has to be moved to another. For this, I need to connect to two database in a springboot project.

Any pointers would be appreciated.

Upvotes: 1

Views: 1214

Answers (1)

Ignasi
Ignasi

Reputation: 6185

You need to provide two different DataSources (two different beans).

Take a look at http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-two-datasources

Upvotes: 3

Related Questions