Loading
Sessions Multiple Databases

Java Quick Notes

Refresh Your Java - Before Java Interview

We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....


Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet

Go to SiteMap

Q)  How to get Hibernate different Sessions for Multiple Databases in same applications ?


Ans)

You have to create two separate hibernate Configurations and create
 two different SessionFactories

          // Create the SessionFactory from hibernate.cfg.xml
            sessionFactory = new Configuration().configure(configFile1).buildSessionFactory();

      // Create SessionFactory from second hibernate.cfg.xml
            sessionFactory1 = new Configuration().configure(configFile2).buildSessionFactory();



Back to top

------------------------- We hope you got necessary Info On -----------------------------------------

Sessions Multiple Databases


Sessions Multiple Databases

-------------------------------------------------------------------------------------------------------



Face Book
Request for a Mock Interview/Training

Get a PDF

Face Book
Same look (Read) on any device, this is Ads free