Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can multiple database connection be build using jdbi

My requirement is too fetch data by joining tables from multiple databases.

Is their any way to setup connection with multiple databases using jbdi

like image 660
Ramandeep Avatar asked May 22 '26 13:05

Ramandeep


1 Answers

Each DBI instance is tied to a single java.sql.DataSource, which I've only seen connect to a single database. So the answer to your question is, probably not.

You can however construct a DBI per database, query them separately, and join the result on your application server.

Depending on your use case (I'm assuming reporting?), it might be more appropriate to look into a data warehouse solution, and set up an ETL (extract, transform, and load) for each of your separate database to feed into the warehouse. Then you can produce reports from the warehouse without impacting performance of the other systems.

like image 145
qualidafial Avatar answered May 25 '26 02:05

qualidafial