diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLAvatarData.cs (renamed from OpenSim/Data/MSSQL/MSSQLAvatarData.cs) | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLAvatarData.cs b/OpenSim/Data/PGSQL/PGSQLAvatarData.cs index 301b424..d9c4905 100644 --- a/OpenSim/Data/MSSQL/MSSQLAvatarData.cs +++ b/OpenSim/Data/PGSQL/PGSQLAvatarData.cs | |||
@@ -27,38 +27,39 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Data; | ||
31 | using System.Reflection; | 30 | using System.Reflection; |
32 | using System.Threading; | 31 | using System.Threading; |
33 | using log4net; | 32 | using log4net; |
34 | using OpenMetaverse; | 33 | using OpenMetaverse; |
35 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
36 | using System.Data.SqlClient; | 35 | using Npgsql; |
36 | using NpgsqlTypes; | ||
37 | 37 | ||
38 | namespace OpenSim.Data.MSSQL | 38 | |
39 | namespace OpenSim.Data.PGSQL | ||
39 | { | 40 | { |
40 | /// <summary> | 41 | /// <summary> |
41 | /// A MSSQL Interface for Avatar Storage | 42 | /// A PGSQL Interface for Avatar Storage |
42 | /// </summary> | 43 | /// </summary> |
43 | public class MSSQLAvatarData : MSSQLGenericTableHandler<AvatarBaseData>, | 44 | public class PGSQLAvatarData : PGSQLGenericTableHandler<AvatarBaseData>, |
44 | IAvatarData | 45 | IAvatarData |
45 | { | 46 | { |
46 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 48 | ||
48 | public MSSQLAvatarData(string connectionString, string realm) : | 49 | public PGSQLAvatarData(string connectionString, string realm) : |
49 | base(connectionString, realm, "Avatar") | 50 | base(connectionString, realm, "Avatar") |
50 | { | 51 | { |
51 | } | 52 | } |
52 | 53 | ||
53 | public bool Delete(UUID principalID, string name) | 54 | public bool Delete(UUID principalID, string name) |
54 | { | 55 | { |
55 | using (SqlConnection conn = new SqlConnection(m_ConnectionString)) | 56 | using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString)) |
56 | using (SqlCommand cmd = new SqlCommand()) | 57 | using (NpgsqlCommand cmd = new NpgsqlCommand()) |
57 | { | 58 | { |
58 | 59 | ||
59 | cmd.CommandText = String.Format("DELETE FROM {0} where [PrincipalID] = @PrincipalID and [Name] = @Name", m_Realm); | 60 | cmd.CommandText = String.Format("DELETE FROM {0} where \"PrincipalID\" = :PrincipalID and \"Name\" = :Name", m_Realm); |
60 | cmd.Parameters.Add(m_database.CreateParameter("@PrincipalID", principalID.ToString())); | 61 | cmd.Parameters.Add(m_database.CreateParameter("PrincipalID", principalID)); |
61 | cmd.Parameters.Add(m_database.CreateParameter("@Name", name)); | 62 | cmd.Parameters.Add(m_database.CreateParameter("Name", name)); |
62 | cmd.Connection = conn; | 63 | cmd.Connection = conn; |
63 | conn.Open(); | 64 | conn.Open(); |
64 | if (cmd.ExecuteNonQuery() > 0) | 65 | if (cmd.ExecuteNonQuery() > 0) |