mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
whole lot more moving
This commit is contained in:
27
OpenSim/Data/MapperFactory/DataMapperFactory.cs
Normal file
27
OpenSim/Data/MapperFactory/DataMapperFactory.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using OpenSim.Framework.Data.Base;
|
||||
using OpenSim.Framework.Data.MSSQLMapper;
|
||||
using OpenSim.Framework.Data.MySQLMapper;
|
||||
|
||||
namespace OpenSim.Framework.Data.MapperFactory
|
||||
{
|
||||
public class DataMapperFactory
|
||||
{
|
||||
public enum MAPPER_TYPE {
|
||||
MySQL,
|
||||
MSSQL,
|
||||
};
|
||||
|
||||
static public BaseDatabaseConnector GetDataBaseMapper(MAPPER_TYPE type, string connectionString)
|
||||
{
|
||||
switch (type) {
|
||||
case MAPPER_TYPE.MySQL:
|
||||
return new MySQLDatabaseMapper(connectionString);
|
||||
case MAPPER_TYPE.MSSQL:
|
||||
return new MSSQLDatabaseMapper(connectionString);
|
||||
default:
|
||||
throw new ArgumentException("Unknown Database Mapper type [" + type + "].");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user