Esempio n. 1
0
        internal Database(IICDbType dbType, string connectionString)
        {
            _configItem                  = new IICDbConfigItem();
            _configItem.DbType           = dbType;
            _configItem.ConnectionString = connectionString;

            _tracing      = TracingManager.GetTracing("Database.[ConnStr=" + connectionString + "]");
            _perfCounters = IICPerformanceCounterFactory.GetCounters <DatabasePerfCounters>(".");

            switch (_configItem.DbType)
            {
            case IICDbType.SqlServer2005:
                _operation = new SqlServerDatabase(_configItem.ConnectionString, 120);
                break;

            case IICDbType.Mysql:
                _operation = new MysqlDatabase(_configItem.ConnectionString, 120);
                break;

            case IICDbType.MysqlBatchInsert:
                _operation = new MysqlBatchInsert(_configItem.ConnectionString);
                break;

            default:
                throw new NotSupportedException(string.Format("Not Support DbType:{0} {1}", _configItem.DbType, _configItem.Name));
            }
        }
Esempio n. 2
0
        private void AssignInnerDb()
        {
            switch (_configItem.DbType)
            {
            case IICDbType.SqlServer2005:
                _operation = new SqlServerDatabase(_configItem.ConnectionString, _configItem.CommandTimeout);
                break;

            case IICDbType.Mysql:
                _operation = new MysqlDatabase(_configItem.ConnectionString, _configItem.CommandTimeout);
                break;

            case IICDbType.MysqlBatchInsert:
                _operation = new MysqlBatchInsert(_configItem.ConnectionString);
                break;

            default:
                throw new NotSupportedException(string.Format("Not Support DbType:{0} {1}", _configItem.DbType, _configItem.Name));
            }
        }
Esempio n. 3
0
 public abstract bool?Save(IDatabaseOperation x);