Пример #1
0
        public DatabaseFactory(DatabaseType.Type type)
        {
            switch (type)
            {
            case DatabaseType.Type.SQLServer: _DbHelper = new DataBaseHelperSQL();
                break;

            case DatabaseType.Type.OracleServer: _DbHelper = new DataBaseHelperOleDb();
                break;

            case DatabaseType.Type.PostgreSQLServer: _DbHelper = new DataBaseHelperOleDb();
                break;

            case DatabaseType.Type.MySQLServer: _DbHelper = new DataBaseHelperOleDb();
                break;

            default: break;
            }
        }
Пример #2
0
        public IDatabaseHelper CreateDBHelper(DatabaseType.Type type, string procedureName)
        {
            switch (type)
            {
            case DatabaseType.Type.SQLServer: _DbHelper = new DataBaseHelperSQL(procedureName);
                break;

            case DatabaseType.Type.OracleServer: _DbHelper = new DataBaseHelperOleDb(procedureName);
                break;

            case DatabaseType.Type.PostgreSQLServer: _DbHelper = new DataBaseHelperOleDb(procedureName);
                break;

            case DatabaseType.Type.MySQLServer: _DbHelper = new DataBaseHelperOleDb(procedureName);
                break;

            default: break;
            }
            return(_DbHelper);
        }