if (jdbcInfo!=null) {
if (jdbcInfoDictionary != null) { newConnectionDictionary.setObjectForKey(jdbcInfoDictionary, "jdbc2Info"); } else if (jdbcInfo!=null) {
    public void resetConnectionDictionaryInModel(EOModel aModel)  {        if(aModel!=null) {            String aModelName=aModel.name();            log.debug("Adjusting "+aModelName);            NSMutableDictionary newConnectionDictionary=null;            if (aModel.adaptorName().indexOf("Oracle")!=-1) {                String serverName= System.getProperty(aModelName + ".DBServer");                serverName=serverName==null ? System.getProperty("dbConnectServerGLOBAL") : serverName;                String userName= System.getProperty(aModelName + ".DBUser");                userName= userName ==null ? System.getProperty("dbConnectUserGLOBAL") : userName;                String passwd= System.getProperty(aModelName + ".DBPassword");                passwd= passwd ==null ? System.getProperty("dbConnectPasswordGLOBAL") : passwd;                if((serverName!=null) || (userName!=null) || (passwd!=null)) {                    newConnectionDictionary=new NSMutableDictionary(aModel.connectionDictionary());                    if (serverName!=null) newConnectionDictionary.setObjectForKey(serverName,"serverId");                    if (userName!=null) newConnectionDictionary.setObjectForKey(userName,"userName");                    if (passwd!=null) newConnectionDictionary.setObjectForKey(passwd,"password");                    aModel.setConnectionDictionary(newConnectionDictionary);                }                            } else if (aModel.adaptorName().indexOf("Flat")!=-1) {                String path= System.getProperty(aModelName + ".DBPath");                path = path ==null ? System.getProperty("dbConnectPathGLOBAL") : path;                if (path!=null) {                                        if (path.indexOf(" ")!=-1) {                        NSArray a=NSArray.componentsSeparatedByString(path," ");                        if (a.count()==2) {                            path = ERXFileUtilities.pathForResourceNamed((String)a.objectAtIndex(0),                                                                                                     (String)a.objectAtIndex(1), null);                        }                    }                } else {                    // by default we take <modelName>.db in the directory we found the model                    path=aModel.path();                    path=NSPathUtilities.stringByDeletingLastPathComponent(path);                    path=NSPathUtilities.stringByAppendingPathComponent(path,aModel.name()+".db");                                    }                newConnectionDictionary=new NSMutableDictionary(aModel.connectionDictionary());                if (path!=null) newConnectionDictionary.setObjectForKey(path,"path");                if (operatingSystem()==WindowsOperatingSystem)                    newConnectionDictionary.setObjectForKey("\r\n","rowSeparator");                aModel.setConnectionDictionary(newConnectionDictionary);            } else if (aModel.adaptorName().indexOf("OpenBase")!=-1) {                String db= System.getProperty(aModelName + ".DBDatabase");                db = db ==null ? System.getProperty("dbConnectDatabaseGLOBAL") : db;                String h= System.getProperty(aModelName + ".DBHostName");                h = h ==null ? System.getProperty("dbConnectHostNameGLOBAL") : h;                if (h!=null || db!=null) {                    newConnectionDictionary=new NSMutableDictionary(aModel.connectionDictionary());                    if (db!=null) newConnectionDictionary.setObjectForKey(db, "databaseName");                    if (h!=null) newConnectionDictionary.setObjectForKey(h, "hostName");                    aModel.setConnectionDictionary(newConnectionDictionary);                }            } else if (aModel.adaptorName().indexOf("JDBC")!=-1) {                String url= System.getProperty(aModelName + ".URL");                url = url ==null ? System.getProperty("dbConnectURLGLOBAL") : url;                String userName= System.getProperty(aModelName + ".DBUser");                userName= userName ==null ? System.getProperty("dbConnectUserGLOBAL") : userName;                String passwd= System.getProperty(aModelName + ".DBPassword");                passwd= passwd ==null ? System.getProperty("dbConnectPasswordGLOBAL") : passwd;                String driver= System.getProperty(aModelName + ".DBDriver");                driver= driver ==null ? System.getProperty("dbConnectDriverGLOBAL") : driver;                String jdbcInfo= System.getProperty(aModelName + ".DBJDBCInfo");                jdbcInfo= jdbcInfo ==null ? System.getProperty("dbConnectJDBCInfoGLOBAL") : jdbcInfo;                String plugin= System.getProperty(aModelName + ".DBPlugin");                plugin= plugin ==null ? System.getProperty("dbConnectPluginGLOBAL") : plugin;                if (url!=null || userName!=null || passwd!=null || driver!=null || jdbcInfo!=null || plugin!=null) {                    newConnectionDictionary=new NSMutableDictionary(aModel.connectionDictionary());                    if (url!=null) newConnectionDictionary.setObjectForKey(url, "URL");                    if (userName!=null) newConnectionDictionary.setObjectForKey(userName,"username");                    if (passwd!=null) newConnectionDictionary.setObjectForKey(passwd,"password");                    if (driver!=null) newConnectionDictionary.setObjectForKey(driver,"driver");                    if (jdbcInfo!=null) {                        NSDictionary d=(NSDictionary)NSPropertyListSerialization.propertyListFromString(jdbcInfo);                        if (d!=null)                            newConnectionDictionary.setObjectForKey(d,"jdbc2Info");                        else                            newConnectionDictionary.removeObjectForKey("jdbc2Info");                    }                    if (plugin!=null) newConnectionDictionary.setObjectForKey(plugin,"plugin");                                        aModel.setConnectionDictionary(newConnectionDictionary);                }            }            if (newConnectionDictionary!=null && log.isDebugEnabled()) {                if (newConnectionDictionary.objectForKey("password")!=null)                    newConnectionDictionary.setObjectForKey("<deleted for log>", "password");                log.debug("New Connection Dictionary for "+aModelName+": "+newConnectionDictionary);                            }                                    // based on an idea from Stefan Apelt <stefan@tetlabors.de>            String f = System.getProperty(aModelName + ".EOPrototypesFile");            f = f ==null ? System.getProperty("EOPrototypesFileGLOBAL") : f;            if(f != null) {                NSDictionary dict = (NSDictionary)NSPropertyListSerialization.propertyListFromString(ERXStringUtilities.stringFromResource(f, "", null));                if(dict != null) {                    if (log.isDebugEnabled()) log.debug("Adjusting prototypes from " + f);                    EOEntity proto = aModel.entityNamed("EOPrototypes");                    if (proto == null) {                        log.warn("No prototypes found in model named \"" + aModelName + "\", although the EOPrototypesFile default was set!");                    } else {                        aModel.removeEntity(proto);                        proto = new EOEntity(dict, aModel);                        proto.awakeWithPropertyList(dict);                        aModel.addEntity(proto);                    }                }            }            String e = System.getProperty(aModelName + ".EOPrototypesEntity");            // global prototype setting not supported yet            //e = e ==null ? System.getProperty("EOPrototypesEntityGLOBAL") : e;            if(e != null) {                // we look for the entity globally so we can have one prototype entity                EOEntity newPrototypeEntity = aModel.modelGroup().entityNamed(e);                if (newPrototypeEntity == null) {                    log.warn("Prototype Entity named "+e+" not found in model "+aModel.name());                } else {                    if (log.isDebugEnabled()) log.debug("Adjusting prototypes to those from entity " + e);                    EOEntity proto = aModel.entityNamed("EOPrototypes");                    if(proto != null) aModel.removeEntity(proto);                                        aModel.removeEntity(newPrototypeEntity);                    newPrototypeEntity.setName("EOPrototypes");                    aModel.addEntity(newPrototypeEntity);                }            }        }            }