I need to connect to a different database at runtime and I do not have the slightest idea how to do it in JPA. I have a database that tells me which one I should connect to according to some parameters to follow. I make my query in the first database and then I want to connect to the second one and that's where I'm standing.
How can I do it? Can I place the database to which I wish to obtain the data?
Example:
Select
*
from
BD1.Empleados;