Example #1
0
        public IDataReader ExecuteQuery(ConnectString connString, string commandText, params object[] args)
        {
            DbAccess          db     = GetDbAccess(connString);
            DataCommandFilter filter = db.CreateCommandFilter(commandText, args);

            return(db.ExecuteReader(filter.CommandText, CommandType.Text, filter.Params));
        }
Example #2
0
        public void BatchInsert(ConnectString connString, MDataSet dataSet)
        {
            DbAccess db = GetDbAccess(connString);

            List <DataCommandFilter> list = new List <DataCommandFilter>();

            foreach (MDataUnit unit in dataSet)
            {
                list.Add(db.CreateCommandFilter(dataSet.CommandText, dataSet.CreateParams(unit)));
            }
            db.ExecuteTransaction(list);
        }
Example #3
0
        protected DbAccess GetDbAccess(ConnectString connString)
        {
            DbAccess result = null;

            switch (Provider)
            {
            case OracleProvider.OracleClient:
                result = new NativeOraDbAccess(connString);
                break;

            case OracleProvider.ManagedDataAccess:
                result = new ManagedOraDbAccess(connString);
                break;
            }
            return(result);
        }
Example #4
0
 public DbAccess(ConnectString connString)
 {
     ConnectString = connString;
 }
Example #5
0
 public NativeOraDbAccess(ConnectString connString) : base(connString)
 {
 }
Example #6
0
        public OracleDbAccess(ConnectString connString) : base(connString)
        {

        }
Example #7
0
 public IEnumerable <TModel> Query <TModel>(ConnectString connString, string commandText, params object[] args)
     where TModel : class, new()
 {
     return(ExecuteQuery(connString, commandText, args).Adapter <TModel>());
 }
Example #8
0
        public void ExecuteTransction(ConnectString connString, List <string> sqls)
        {
            DbAccess db = GetDbAccess(connString);

            db.ExecuteTransaction(sqls);
        }
Example #9
0
 public ManagedOraDbAccess(ConnectString connString) : base(connString)
 {
 }