예제 #1
0
        public virtual IDb OpenDb(IDbConnection cn)
        {
            OrlDb db = new OrlDb(this, cn);

            db.IsAdapter = true;
            return(db);
        }
예제 #2
0
        public virtual IDb OpenDb()
        {
            IDbConnection cn = new Oracle.DataAccess.Client.OracleConnection(connString);
            //cn.Open();
            IDb db = new OrlDb(this, cn);

            return(db);
        }
예제 #3
0
 public virtual void CloseDb(OrlDb db)
 {
     if (!db.IsClosed)
     {
         if (!db.IsAdapter && db.Connection != null)
         {
             Oracle.DataAccess.Client.OracleConnection cn = (Oracle.DataAccess.Client.OracleConnection)db.Connection;
             if (cn.State != ConnectionState.Closed)
             {
                 cn.Close();
             }
             cn.Dispose();
             db.Connection = null;
         }
     }
 }
예제 #4
0
 public virtual void OpenDb(OrlDb db)
 {
     if (db.IsClosed)
     {
         if (db.Connection == null)
         {
             db.Connection = new Oracle.DataAccess.Client.OracleConnection(connString);
             db.Connection.Open();
         }
         else
         {
             if (db.Connection.State == ConnectionState.Closed)
             {
                 db.Connection.Open();
             }
         }
     }
 }