aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MapperFactory/DataMapperFactory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/MapperFactory/DataMapperFactory.cs')
-rw-r--r--OpenSim/Data/MapperFactory/DataMapperFactory.cs27
1 files changed, 27 insertions, 0 deletions
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 @@
1using System;
2using OpenSim.Framework.Data.Base;
3using OpenSim.Framework.Data.MSSQLMapper;
4using OpenSim.Framework.Data.MySQLMapper;
5
6namespace OpenSim.Framework.Data.MapperFactory
7{
8 public class DataMapperFactory
9 {
10 public enum MAPPER_TYPE {
11 MySQL,
12 MSSQL,
13 };
14
15 static public BaseDatabaseConnector GetDataBaseMapper(MAPPER_TYPE type, string connectionString)
16 {
17 switch (type) {
18 case MAPPER_TYPE.MySQL:
19 return new MySQLDatabaseMapper(connectionString);
20 case MAPPER_TYPE.MSSQL:
21 return new MSSQLDatabaseMapper(connectionString);
22 default:
23 throw new ArgumentException("Unknown Database Mapper type [" + type + "].");
24 }
25 }
26 }
27}