Beispiel #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));
            }
        }
 public static Database GetDatabase(IICDbType dbType, string connString)
 {
     return new Database(dbType, connString);
 }
Beispiel #3
0
 public static Database GetDatabase(IICDbType dbType, string connString)
 {
     return(new Database(dbType, connString));
 }