Ejemplo n.º 1
0
        /// <summary>
        /// 쿼리를 실행한다.
        /// </summary>
        /// <param name="Query"></param>
        /// <param name="Params"></param>
        /// <param name="writelog"></param>
        /// <returns></returns>
        public DataSet dsExcute_Query(string Query, OracleParameter[] Params, bool writelog = false)
        {
            int Count = 0;

            while (this.retryTimes_Query >= Count)
            {
                try
                {
                    Count++;

                    Query = Fnc.RemoveSpLetter(Query);

                    return(dsexcute_Query(Query, Params, writelog));
                }
                catch (Exception ex)
                {
                    if (Log != null & writelog)
                    {
                        Log.WLog_Exception(string.Format("SQLDB.Excute_Query[{0}번째", Count), ex);
                    }

                    if (Count == this.RetryTimes_Query)
                    {
                        throw ex;
                    }

                    Thread.Sleep(retrySleepTime);
                }
            }

            return(null);
        }
Ejemplo n.º 2
0
        private int intexcute_Query(string Query, bool writelog = false)
        {
            try
            {
                DB_isOpen();

                if (Query.Trim() == "")
                {
                    throw new Exception("쿼리에 문제가 있습니다.(길이 0)");
                }

                Dbcmd.Parameters.Clear();
                this.Dbcmd.Connection = this.Dbconn;
                Dbcmd.CommandType     = CommandType.Text;
                Dbcmd.CommandText     = Fnc.RemoveSpLetter(Query);

                if (Log != null & writelog)
                {
                    Log.WLog("[OracleDB 쿼리 실행]{0}", Query);
                }

                int intRst = Dbcmd.ExecuteNonQuery();

                Dbcmd.Dispose();

                return(intRst);
            }
            catch (OracleException ex)
            {
                throw new Exception(string.Format("쿼리 실행 Err(Oracle) : {0} / 쿼리 : {1}", ex.Message, Query), ex);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("DB Open Err(일반) : {0}", ex.Message), ex);
            }
            finally
            {
                if (!this.isTaransaction)
                {
                    this.DB_Close();
                }
            }
        }