Exemplo n.º 1
0
        public void GetDbProviderFactory_SQLITE()
        {
            string            name    = new SqliteTranslator().ProviderInvariantName;
            DbProviderFactory factory = DbDriveFactories.GetFactory(name);

            Assert.True(factory != null);
        }
Exemplo n.º 2
0
        private IDbTranslator getDbTranslator(IDataSetting dataSetting)
        {
            IDbTranslator dbTranslator;

            switch (dataSetting.DataSouceType)
            {
            case DataSouceType.MySQL:
                dbTranslator = new MySQLTranslator();
                break;

            case DataSouceType.Oracle:
                dbTranslator = new OracleTranslator();
                break;

            case DataSouceType.Sql2000:
                dbTranslator = new Sql2000Translator();
                break;

            case DataSouceType.Sql2005:
                dbTranslator = new Sql2005Translator();
                break;

            case DataSouceType.Sql2008:
                dbTranslator = new Sql2008Translator();
                break;

            case DataSouceType.Sqlite:
                dbTranslator = new SqliteTranslator();
                break;

            default:
                throw new MapleException(string.Format("未知的数据源类型“{0}”。请核实数据源类型配置是否正确。", dataSetting.DataSouceType));
            }

            return(dbTranslator);
        }