Re: EOModel Deployment & Configuration
Re: EOModel Deployment & Configuration
- Subject: Re: EOModel Deployment & Configuration
- From: Robert Walker <email@hidden>
- Date: Thu, 21 Jul 2005 19:27:06 -0400
EOModel class has a method to retrieve the connectionDictionary();
Get your model form the EOModelGroup.defaultGroup();
Then set the values you want programatically using NSKeyValueCoding
on a new NSMutableDictionary.
Something like:
NSDictionary origCon = myModel.connectionDictionary();
NSMutableDictionary myCon = new NSMutableDictionary();
myCon.takeValueForKey("jdbc:openbase://db.domain.com/MyDB", "url");
myCon.takeValueForKey(origCon.valueForKey("username");
myCon.takeValueForKey(origCon.valueForKey("password");
myModel.setConnectionDictionary(myConnectionDictionary);
Not sure if all that is exactly right so you may need to do some
experimenting on your own. But it should get you started.
On Jul 21, 2005, at 6:43 PM, Colin Shreffler wrote:
How do I change my database connection information in my EOModel
for each
of my environments?
When I deploy my application, I want it to point to a different
database
than when I'm working in Dev without having to change the connection
properties every time that I deploy.
Also: Is there a way to programatically set the connection
information so
that perhaps I could read the information from an xml file during run
time?
Thank you,
-c
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden