Consider a situation where all client data is stored in its own database/catalog and all such databases are stored in a single RDBMS (client-data). Master data (e.g. clients, ...) is kept in another RDBMS (master-data). How can we dynamically access a particular database in client-data RDBMS by means of JdbcTemplate
?
Defining DataSource
for each database in client-data RDBMS and then dynamically select one as suggested here is not an option for us since the databases are created and destroyed dynamically.
I would basically need something like JDBC's Connection.setCatalog(String catalog)
but I have not found anything like that available in Spring JdbcTemplate
.