-->
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.  [ 2 posts ] 
Author Message
 Post subject: Questions on setting configuration
PostPosted: Sun Feb 12, 2006 12:25 pm 
Newbie

Joined: Sun Feb 12, 2006 12:17 pm
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

NHibernate version: 1

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

Can I configurate nhibernate without using external xml file (hibernate.cfg.xml)? Because the database password is in that file, so I want to set it in the program. Can someone tell me how to do that?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 12, 2006 6:17 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Here's a rough example:
Code:
IDictionary myProperties = new Hashtable();
myProperties["some.property.name"] = "property value, must be a string";
Configuration cfg = new Configuration().SetProperties(myProperties)
    .Add...();
ISessionFactory sessionFactory = cfg.BuildSessionFactory();


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.