|
Hi guys,
I have a trivial problem, but i couldn´t find out a elegant solution for it.
I need to connect to a 2 different databases, each one with different configuration, drivers and anything else.
What is the best way to do this ?
I thought the best way was making two different hibernate.cfg.xml. One for each database and pass the file name as an argument when creating a session factory: new Configuration().configure("database1.cfg.xml");
But, for some reason, hibernate keeps looking for the file named hibernate.cfg.xml even if i pass the filename as argument in configure() method. What am i doing wrong ?
this is the error
org.hibernate.HibernateException: /hibernate.cfg.xml not found
Any ideas will be appreciated
thanks in advance
|