Can we use multiple datasources with jdbi in spring boot project

399 Views Asked by At

Can we use multiple datasources with jdbi.

Will the configuration will be same as what we have with JPA : https://www.baeldung.com/spring-data-jpa-multiple-databases

1

There are 1 best solutions below

0
On

So, in first, you can set more than one database for your application with JDBI, exactely like JDBC. You just have to set them inside your application.properties.

Second, if you want to use JDBI, you'll use a kind of classical queries, instead of a dialect for JPA/hibernate inside repositories.

You can read this discussion to compare them : Benchmarking spring data vs JDBI in select from postgres Database