Hello Baiss;

If I split off the FrontBase database to a different computer on the deployment side, how do I change the "setting" which will allow the WO apps being run to look for the database on another computer?

I get the information I want from my own configuration infrastructure then I do something like this, which is probably the bit you're after...

    public static void setDBConnectionForNamedModel(
        String modelName,
        String jdbcDriver,
        String jdbcUrl,
        String username,
        String password)
    {
        if((null==modelName) || (0==modelName.length()))
            return;

EOModel model = EOModelGroup.defaultGroup().modelNamed (modelName);

        if(null==model)
throw new LEError("cannot locate the model named '"+modelName+"'");

        NSMutableDictionary d = new NSMutableDictionary();
        
        if(null!=model.connectionDictionary())
                d.addEntriesFromDictionary(model.connectionDictionary());
        
        d.setObjectForKey(jdbcDriver, JDBCAdaptor.DriverKey);
        d.setObjectForKey(jdbcUrl, JDBCAdaptor.URLKey);
        d.setObjectForKey(username, JDBCAdaptor.UsernameKey);
        d.setObjectForKey(password, JDBCAdaptor.PasswordKey);

        String plugIn = JDBCPlugIn.plugInNameForURL(jdbcUrl);
                
        if(null==plugIn)
throw new LEError("unable to find JDBC plugin for JDBC URL '"+jdbcUrl+"'");
        else
                d.setObjectForKey(plugIn, JDBCAdaptor.PlugInKey);

        model.setConnectionDictionary(d);
    }

cheers.

___
Andrew Lindesay
www.lindesay.co.nz



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to