Esempio n. 1
0
        protected bool CreateConnectionUrl()
        {
            bool   flag = false;
            string strA = this.Config.getDatabaseType();

            if (string.Compare(strA, "mysql", true) == 0)
            {
                this.ConnectionUrl = new MySqlUrl();
                flag = true;
            }
            else if (string.Compare(strA, "oracle", true) == 0)
            {
                this.ConnectionUrl = new OracleUrl();
                flag = true;
            }
            else if (string.Compare(strA, "sqlserver", true) == 0)
            {
                this.ConnectionUrl = new SqlServerUrl();
                flag = true;
            }
            if (this.ConnectionUrl != null)
            {
                this.ConnectionUrl.setServer(this.Config.getServer());
                this.ConnectionUrl.setDatabase(this.Config.getDatabase());
                this.ConnectionUrl.setUser(this.Config.getUser());
                this.ConnectionUrl.setPassword(this.Config.getPassword());
            }
            return(flag);
        }
Esempio n. 2
0
 protected bool CreateConnectionUrl()
 {
     bool flag = false;
     string strA = this.Config.getDatabaseType();
     if (string.Compare(strA, "mysql", true) == 0)
     {
         this.ConnectionUrl = new MySqlUrl();
         flag = true;
     }
     else if (string.Compare(strA, "oracle", true) == 0)
     {
         this.ConnectionUrl = new OracleUrl();
         flag = true;
     }
     else if (string.Compare(strA, "sqlserver", true) == 0)
     {
         this.ConnectionUrl = new SqlServerUrl();
         flag = true;
     }
     if (this.ConnectionUrl != null)
     {
         this.ConnectionUrl.setServer(this.Config.getServer());
         this.ConnectionUrl.setDatabase(this.Config.getDatabase());
         this.ConnectionUrl.setUser(this.Config.getUser());
         this.ConnectionUrl.setPassword(this.Config.getPassword());
     }
     return flag;
 }