my dog learned polymorphism*
The moose likes Object Relational Mapping and the fly likes Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate" Watch "Hibernate" New topic
Author

Hibernate

arul meh
Greenhorn

Joined: Sep 19, 2009
Posts: 27
I have to use one table from remote database along with existing database in our own project. Any help will be appreciated. My project is using hibernate and struts.

Thanks,
Arul
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

And what is your question?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Sean Clark
Rancher

Joined: Jul 15, 2009
Posts: 377

Hey,

My advice is to plan before you start.

Sean


I love this place!
arul meh
Greenhorn

Joined: Sep 19, 2009
Posts: 27
I have to save some data in a table which is not in my projects'database. It is a central table in my company for saving requests for all clients for all projects. I have to save request in that table through my project. I am having problem to access it.

Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

OK. You will need two SessionFactories, one for each DataSource. Your data access layer can abstract your domain layer from this detail.
vikas bala
Greenhorn

Joined: Dec 26, 2006
Posts: 19
You need to have two different hibernate configuration file one for each data source.
When you get the session factory instance use the appropriate hibernate configuration file to establish a database connection.


--Vikas


hugs <br />Vikas
arul meh
Greenhorn

Joined: Sep 19, 2009
Posts: 27
Thanks Vikas and Paul.
 
Consider Paul's rocket mass heater.
 
subject: Hibernate