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)); }
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); }
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); }
public DbAccess(ConnectString connString) { ConnectString = connString; }
public NativeOraDbAccess(ConnectString connString) : base(connString) { }
public OracleDbAccess(ConnectString connString) : base(connString) { }
public IEnumerable <TModel> Query <TModel>(ConnectString connString, string commandText, params object[] args) where TModel : class, new() { return(ExecuteQuery(connString, commandText, args).Adapter <TModel>()); }
public void ExecuteTransction(ConnectString connString, List <string> sqls) { DbAccess db = GetDbAccess(connString); db.ExecuteTransaction(sqls); }
public ManagedOraDbAccess(ConnectString connString) : base(connString) { }