From c52c68f314c67c76c7181a6d0828f476290fbd66 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 2 Apr 2008 15:24:31 +0000 Subject: whole lot more moving --- OpenSim/Data/MapperFactory/DataMapperFactory.cs | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 OpenSim/Data/MapperFactory/DataMapperFactory.cs (limited to 'OpenSim/Data/MapperFactory') diff --git a/OpenSim/Data/MapperFactory/DataMapperFactory.cs b/OpenSim/Data/MapperFactory/DataMapperFactory.cs new file mode 100644 index 0000000..8995b9e --- /dev/null +++ b/OpenSim/Data/MapperFactory/DataMapperFactory.cs @@ -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 + "]."); + } + } + } +} -- cgit v1.1