You could specify the hibernate configuration filepath String or as a File object as a parameter of configure() method while creating the SessionFactory object. Something like this...
Code:
SessionFactory sF = new Configuration().configure("filepath String").buildSessionFactory();
OR
SessionFactory sF = new Configuration().configure(new File("filepath String")).buildSessionFactory();
This allows to create multiple SessionFactory objects with different hibernate configuration files connecting to different databases. Check out the API
http://www.hibernate.org/hib_docs/v3/api/org/hibernate/cfg/Configuration.html
I hope this helps.
__________________________________________________________
Please don't forget to
RATE if this post was helpful