diff options
author | Sean Dague | 2008-04-02 15:24:31 +0000 |
---|---|---|
committer | Sean Dague | 2008-04-02 15:24:31 +0000 |
commit | c52c68f314c67c76c7181a6d0828f476290fbd66 (patch) | |
tree | 66ab347502892902a096fa985f31b25738eb1381 /OpenSim/Data/MapperFactory | |
parent | reorganizing namespaces to put all the Data stuff into it's own namespace (diff) | |
download | opensim-SC-c52c68f314c67c76c7181a6d0828f476290fbd66.zip opensim-SC-c52c68f314c67c76c7181a6d0828f476290fbd66.tar.gz opensim-SC-c52c68f314c67c76c7181a6d0828f476290fbd66.tar.bz2 opensim-SC-c52c68f314c67c76c7181a6d0828f476290fbd66.tar.xz |
whole lot more moving
Diffstat (limited to 'OpenSim/Data/MapperFactory')
-rw-r--r-- | OpenSim/Data/MapperFactory/DataMapperFactory.cs | 27 |
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 @@ | |||
1 | using System; | ||
2 | using OpenSim.Framework.Data.Base; | ||
3 | using OpenSim.Framework.Data.MSSQLMapper; | ||
4 | using OpenSim.Framework.Data.MySQLMapper; | ||
5 | |||
6 | namespace 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 | } | ||