Example #1
0
        internal void AddDBConnection(ConnectionVO connVO)
        {
            //잘못된 URL형식 걸러내기
            if (!(connVO.ServiceURL.Contains("http://")) || (connVO.ServiceURL.Replace("http://", string.Empty).Length == 0))
            {
                return;
            }

            try
            {
                IDBService DBModel = new PostgresSQLDBServicecs(connVO);
                ConnDic.Add(connVO.ServiceURL, DBModel);
                ActiveDBKeyList.Add(connVO.ServiceURL);
            }
            catch (Exception ex)
            {
                LogController.getInstance().WriteLogFile(ex.Message);
            }
        }
Example #2
0
 internal void DropDB(ConnectionVO connVO)
 {
     try
     {
         //db가  존재하는지 검증
         IDBService ds = new PostgresSQLDBServicecs(connVO);
         ds.Dispose();
     }
     catch (Exception)
     {
         return; //DB가 없는 경우는 그냥 나간다
     }
     try
     {
         //DB에 연결되어 있는 경우는 연결 종료한다
         ConnDic[connVO.ServiceURL].Dispose();
     }
     catch (Exception) { }
     PostgresSQLDBServicecs.DropDB(connVO);
 }
Example #3
0
 internal void CreateDB(ConnectionVO connVO)
 {
     try
     {
         //db가 이미 존재하는지 검증
         IDBService ds = new PostgresSQLDBServicecs(connVO);
         ds.Dispose();
         return;
     }
     catch (Exception)
     {
         //DB가 없으면 DB를 만든다
         PostgresSQLDBServicecs.CreateDB(connVO);
         PostgresSQLDBServicecs.ExecScript(string.Format("{0}\\lib\\htpDBSchema.sql", Environment.CurrentDirectory), connVO);
     }
 }