title: How to connect to multiple databases in Hibernate
body: <p>I am new bee to Hibernate and trying out things.
  One thing that seems to amuse all is how to connect to different databases?
  I have two questions here:</p>
  
  <ol>
  <li>If in the same web app I need to connect to MySQL and Oracle, how do I do it?  </li>
  <li>I am using MySQL and have two databases test1 and test2, how to connect and retrieve data?</li>
  </ol>
  
  <p>I have read in a blog that we can create different configuration files and do it.
  I tried it but was not sucessful.
  Here's what I tried: </p>
  
  <pre><code>SessionFactory sf = (SessionFactory) new Configuration().configure(path);
  </code></pre>
  
  <p>Where path is the path of the config file.
  Is this the right way?</p>