Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate

 
arul meh
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what is your question?
 
Sean Clark
Rancher
Posts: 377
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

My advice is to plan before you start.

Sean
 
arul meh
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
arul meh
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Vikas and Paul.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic