Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Object Relational Mapping and the fly likes using several types of databases in a single web application with hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "using several types of databases in a single web application with hibernate" Watch "using several types of databases in a single web application with hibernate" New topic
Author

using several types of databases in a single web application with hibernate

sulthana md
Greenhorn

Joined: Aug 24, 2011
Posts: 3


Hi,
Can anyone help me out "how can we use several types of database like MYSQL, DB2 etc in a single web application using HIBERNATE ?"
Here for each type of database we will be having different 'hibernate.cfg.xml' file. where do we specify the type of database we want to use? Help me regarding the syntax.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3817

You can bind each factory to JNDI and retrieve them where needed (JNDI-bound session factory).

And welcome to the CodeRanch!


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
sulthana md
Greenhorn

Joined: Aug 24, 2011
Posts: 3
Vijitha Kumara wrote:You can bind each factory to JNDI and retrieve them where needed (JNDI-bound session factory).

And welcome to the CodeRanch!


the information is very useful .
Thanks VIjitha
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: using several types of databases in a single web application with hibernate
 
Similar Threads
Spring JDBC Vs Hibernate?
which framework for online advertisement website???
Hibernate: Throws Clobs are not cacheable Exception when try to cache
Tabindex for multiple rows in Display tag
Need a good website or book which walks me through developing a J2EE Web Application