title: How to configure multiple DataSources for multitenancy in Hibernate
body: <p>I am trying to add multitenancy to a java application using the separate schema approach as outlined in <a href="http://relation.to/Bloggers/HibernateAndMultitenancyWebinar" rel="nofollow noreferrer">this webinar</a></p>
  
  <p>I wanted to know how would I configure multiple data sources via spring perhaps by using properties files and get the data sources from the spring context based on tenant id.</p>
  
  <p>More importantly, though I want to be able to configure my custom connection provider implementation that supports this multitenancy feature to be used by Hibernate instead of the injected <code>ConnectionProvider</code> that it uses by default. </p>
  
  <p>How can i achieve this.</p>