title: Using AbstractRoutingDataSource to dynamically change the database schema/catalog
body: <p>According to <a href="http://blog.springsource.com/2007/01/23/dynamic-datasource-routing/" rel="noreferrer">this article</a>, you can use the AbstractRoutingDataSource from Spring Framework to dynamically change the data source used by the application.</p>
  
  <p>However, the data sources used are defined by configuration, instead of programmatically. Is there a way of configuring the data sources to be used at runtime?</p>
  
  <p>How scalable is this solution, i.e., what are the limitations in number of data sources?</p>
  
  <p>Thanks!</p>