-->
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: Connecting to database known only only by application
PostPosted: Fri Sep 17, 2004 3:02 pm 
Newbie

Joined: Fri Sep 17, 2004 2:31 pm
Posts: 2
Hi, i have the following to implement:

    A web app used to store projects.
    Individual projects are store in separate database (requirement i cant change)
    Projects are created by users registered to the system. (ie, databases that exists will not be known beforehand)
    Users have many-one association with projects.
    The only database known beforehand (lets call it database A), is used to store the databases created and the users associated.
I am not sure how i should implement the connection to the database, as most documentations/articales i read had the database connection configured on xml/properties files. (which is not possible in my case) Basically, i think i have to connect to database A when the application starts (which is easy since database A can have settings in the config files) and the application will connect to another database depending on the user who logged in.

Any comments appreciated. Thanks.

-Jo


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 17, 2004 3:27 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Look at the Configuration object API, you can configure all this dynamically.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 18, 2004 12:38 am 
Newbie

Joined: Fri Sep 17, 2004 2:31 pm
Posts: 2
Thks, so i simply set the connections setting using the .setProperty(propertyName,value) method? and then use the configuration object to create a new SessionFactory using the buildSessionFactory()?


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.