Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-07-2007, 05:23 AM
Member
 
Join Date: May 2007
Posts: 38
Rep Power: 0
Marty is on a distinguished road
Default Hibernate with multiple database
Hello people
Does anybody use hibernate to access to a multiple database?
I searched in internet but I donīt understand and the documentation of hibernate says:


How do I use multiple databases?
You must configure multiple SessionFactory instances.
If you have more information, please tell me

Marty
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 05-07-2007, 07:06 AM
Senior Member
 
Join Date: Mar 2007
Posts: 135
Rep Power: 0
goldhouse is on a distinguished road
Default
Hibernate has a configuration file called hibernate.properties or hibernate.cfg.xml. There you can specify the properties of database like
Code:
hibernate.connection.driver_class	jdbc driver class
hibernate.connection.url	jdbc URL
hibernate.connection.username	database user
hibernate.connection.password	database user password
hibernate.connection.pool_size	maximum number of pooled connections
By default if you download the hibernate source , it will working on hsqldb.
I have tried hibernate in oracle, mysql, hsqldb
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-07-2007, 05:56 PM
Member
 
Join Date: Apr 2007
Location: Indiana
Posts: 85
Rep Power: 0
pegitha is on a distinguished road
Send a message via Skype™ to pegitha
Default
I have used Hibernate with two databases. You just need to make two datasources then call the one you need for the specific query. I have most recently been using hibernate with Spring but I looked up some old code and what I did was made two different SessionFactories, and so I would call either one or the other session from the factory.
session = DBUtil.getABCSession();
or
session = DBUtil.getDEFSession();
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 12-23-2008, 01:57 PM
Member
 
Join Date: Dec 2008
Posts: 1
Rep Power: 0
shekharreddy is on a distinguished road
Default Hi Guys
can u help to extracting .tar file in java code? pls

thanks
-shekhar
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hibernate with multiple databases dsr0781 Database 5 06-23-2008 02:06 PM
Database connectivity in Jave struts with Hibernate sanjay_sharma77 Advanced Java 1 02-02-2008 09:41 PM
How can I store an image to the database using hibernate cryss_tyna Database 0 08-15-2007 02:48 PM
Hibernate 2.1.8 / Oracle 10 / Tomcat 5.0.28 : Data not retrieved from the database scastro Database 4 08-09-2007 11:41 PM
org.hibernate.ejb.Version <clinit> INFO: Hibernate EntityManager 3.2.0.CR1 Heather Database 2 06-30-2007 04:01 PM


All times are GMT +2. The time now is 06:28 AM.



VBulletin, Copyright Đ2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright Đ2006 - 2007, www.java-forums.org