aspose file tools*
The moose likes Object Relational Mapping and the fly likes Configuring Hibernate with two databases Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Configuring Hibernate with two databases" Watch "Configuring Hibernate with two databases" New topic
Author

Configuring Hibernate with two databases

Renjith Mohan
Ranch Hand

Joined: Nov 28, 2008
Posts: 65


I am developing one Swing application where I need to integrate hibernate. The application has to connect to two databases. Since I am a novice in hibernate, I googled and came to know 2 configuration files are required to accomplish this. As per that I have two sets of:
1. hibernate.cfg.xml and
2. hibernate.properties

I created one HibernateUtil class also. But my doubt is how can I get session factory instance of each database?
Also since this is desktop application, so there is no need for pool of connection, what is the configuration in hibernate for that ? (Normally, in most of the sites, I found hibernate configuration files with datasource mapping.)

Please help me

Thanks in advance
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Configuring Hibernate with two databases
 
Similar Threads
Hibernate: Accessing more than one database in the same transaction
Hibernate: Accessing multiple databases within same transaction
Mutiple DBs and one Session Factory???
How internally works
Use of two configuration xml file using Jconfig