title: Spring-boot JPA connect to postgres where database and schema are provided at runtime
body: <p>I am building a multi-tenant application, where the tenant database configuration are stored in Redis. Based on the request, I will query the Redis to get the database and schema configured for that tenant, this application is built on spring boot. </p>
  
  <p>I took a look at spring boot's JPA sample, and did some more google to find a suitable solution for this, unfortunately, I couldn't find one.</p>
  
  <p>Is this really possible to use JPA sample provided here ?
  <a href="https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-data-jpa" rel="nofollow">https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-data-jpa</a></p>
  
  <p>Please suggest me any other best possible way to tackle this problem</p>
  
  <p>Thanks</p>