Exemple #1
0
        private List <SQLDBLink> GetDBLinks(string sqlDialect)
        {
            List <SQLDBLink> ret = new List <SQLDBLink>();

            this.ProgressInfo.CreateProgress();
            int count = 0;

            try
            {
                // sql commands

                List <string> sqls = this.GetSQLCommands(sqlDialect, "dblinks", null);

                List <SQLResult> result = new List <SQLResult>();
                int iiItem = 0;
                foreach (var item in sqls)
                {
                    this.ProgressInfo.SetProgressDone((double)100 * ++iiItem / sqls.Count, item);
                    DBExecutor.RunSql(result, item);
                }

                foreach (var item in result)
                {
                    SQLDBLink dblinkItem = new SQLDBLink()
                    {
                        owner    = item.Column0,
                        name     = item.Column1,
                        userName = item.Column2,
                        host     = item.Column3,
                    };

                    ret.Add(dblinkItem);
                    count++;
                }
            }
            catch (Exception)
            {
                throw;
            }
            this.ProgressInfo.RemoveProgress();

            return(ret);
        }
Exemple #2
0
        private List <SQLDBLink> GetDBLinks(string sqlDialect)
        {
            List <SQLDBLink> ret = new List <SQLDBLink>();

            int count = 0;

            try
            {
                // sql commands

                List <string> sqls = this.GetSQLCommands(sqlDialect, Purpose.DBLINKS, true, null);

                List <SQLResult> result = new List <SQLResult>();

                foreach (var item in sqls)
                {
                    //this.ProgressInfo.SetProgressDone((double)100 * ++iiItem / sqls.Count, item);
                    DBExecutor.RunSql(result, item);
                }

                foreach (var item in result)
                {
                    this.ProgressInfo.SetProgressPercent(62 + 20 * (count / result.Count), String.Format("Colleting DB links({0}/{1}).", count, result.Count));

                    SQLDBLink dblinkItem = new SQLDBLink()
                    {
                        owner    = item.Column0,
                        name     = item.Column1,
                        userName = item.Column2,
                        host     = item.Column3,
                    };

                    ret.Add(dblinkItem);
                    count++;
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(ret);
        }
Exemple #3
0
        private List<SQLDBLink> GetDBLinks(string sqlDialect)
        {
            List<SQLDBLink> ret = new List<SQLDBLink>();

            this.ProgressInfo.CreateProgress();
            int count = 0;
            try
            {
                // sql commands

                List<string> sqls = this.GetSQLCommands(sqlDialect, "dblinks", null);

                List<SQLResult> result = new List<SQLResult>();
                int iiItem = 0;
                foreach (var item in sqls)
                {
                    //this.ProgressInfo.SetProgressDone((double)100 * ++iiItem / sqls.Count, item);
                    DBExecutor.RunSql(result, item);
                }

                foreach (var item in result)
                {
                    SQLDBLink dblinkItem = new SQLDBLink()
                    {
                        owner = item.Column0,
                        name = item.Column1,
                        userName = item.Column2,
                        host = item.Column3,
                    };

                    ret.Add(dblinkItem);
                    count++;
                }
            }
            catch (Exception)
            {
                throw;
            }
            this.ProgressInfo.RemoveProgress();

            return ret;
        }