i just wanted to know how can we use 2 databases using hibernates. --> to create some tables in mysql server and some other databases in say oracle server. we can define 2 sessionfactory in <hibernate-configuration>. but how to specify specific table to be created in particular database. if anyone knows please reply.any response will be appreciated. thank you.
You want to create one logical model that spans two physical databases of different types? That is a very unusual setup. Typically, if you did want to do this the databases would be the same type and you would let the database itself manage the data model, and Hibernate would just use it as if it were one database. Why do you need to do this? [ November 10, 2006: Message edited by: Paul Sturrock ]
thanks for the reply. In one of the seminars i attended on hibernates i got this question. so i just wanted to know whether it is possible to use 2 databases from hibernates in a single application.
Ah perhaps I misunderstood your original question. Using two or more database from one application via Hibernate is easy. Just create a SessionFactory for each schema and swap as appropriate, Hibernate will manage the differences between the databases transparently.
Having one model split across two databases is not easy though.