• Post Reply Bookmark Topic Watch Topic
  • New Topic

Switch between one Database to other Database with minimal impact on same database server?

 
Nicky narayan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I havae Product,Item databses in the MYSQLServer .I want to switch between these two Databases in the Hibernate.
How can i do this ?


 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy Greenhorn! Welcome to the JavaRanch.

Mapping a single application to two databases, and having all the benefits of mapping to a single database, can be a challenge. To address this, Hibernate has a special project called Shards. So, if it's two separate databases you're trying to connect to, you might want to look at it. If you just want to do it very simply, you can have two SessionFactory objects, one for each database. But you won't be able to single entities to these two different databases, which is probably what you're looking for.

-Cameron McKenzie
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!