-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Connection Question...
PostPosted: Tue Dec 06, 2005 10:58 am 
Newbie

Joined: Tue Dec 06, 2005 10:38 am
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0.5

Name and version of the database you are using: MySQL 5.0


Just started using Hibernate and I was looking at the auction example code...I was wondering how the environment/SessionFactory/Session objects knew what database to connect with...

I remember changing the hibernate.properties file's connection URL to point to jdbc:mysql://localhost:3306/test, but I remember doing this as part of building Hibernate...How is hibernate.properties associated with or used by the auction example code?

How can my app possibly connect to multiple databases, if necessary?


TIA,
Mark Shadle


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 06, 2005 12:23 pm 
Beginner
Beginner

Joined: Tue Apr 05, 2005 4:27 pm
Posts: 40
Location: canada
for multiple databases you need to configure multiple session factories with different config/properties files.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 06, 2005 1:30 pm 
Newbie

Joined: Tue Dec 06, 2005 10:38 am
Posts: 2
Thanks...I guess I should have built the javadocs and checked them out before posting because I found exactly what you suggested...I found the Configuration API and realized I could setProperty on it and create a new SessionFactory from the updated Configuration...

Thanks again...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.