title: How to connect multiple databases in JPA?
body: <p>I have a Spring Boot App which is currently connected to a single database using JPA. Connection details in its application.properties file:</p>
  
  <pre><code>spring.datasource.url=jdbc:oracle:thin:@localhost:1522:orcl
  spring.datasource.username=example
  spring.datasource.password=example
  spring.datasource.driver.class=oracle.jdbc.driver.OracleDriver
  </code></pre>
  
  <p>Now I have a new database I would like to connect to, so my application connects with 2 databases now. I can connect it using JDBC, there I will have to manually write connection code.</p>
  
  <p>I have looked for solutions. Some are in hibernate with multiple config files. Others are using JDBC. </p>
  
  <p>I tried looking in spring docs if there are provisions for defining multiple datasources in application.properties file, but couldn't find anything.</p>
  
  <p>I would like to know if a solution exists using JPA alone. Thanks for your time.</p>