This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Cross database query using hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Cross database query using hibernate" Watch "Cross database query using hibernate" New topic

Cross database query using hibernate

Rahul Solanki

Joined: Aug 02, 2011
Posts: 4
Currently we have 2 databases on our system where we are using linked servers (SQL SERVER) to fetch the data from both the servers (Cross database query).

In future we would like to move our Database from SQL Server to MySQL and thus we does not won't to use native sql or stored procedures as it will add extra efforts for the database migration project.

Now I am trying to implement hibernate using POJOs but my cfg files are pointing to 2 different servers. How can I achieve connectivity between 2 different databases or querying between 2 different database tables.

Please suggest the best way to implement this using Hibernate.

Please suggest how to achieve or suggest a better way of doing it.

Don't get me started about those stupid light bulbs.
subject: Cross database query using hibernate
Similar Threads
Calling Session.lock(object, LockMode.READ)
Active Query Builder-Product Question!
Database Query using Hibernate
Hibernate is not recognizing SQL's 'FREETEXT' keyword
What to learn first for Java?