aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/MSSQLAvatarData.cs
diff options
context:
space:
mode:
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
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Data;
31using System.Reflection; 30using System.Reflection;
32using System.Threading; 31using System.Threading;
33using log4net; 32using log4net;
34using OpenMetaverse; 33using OpenMetaverse;
35using OpenSim.Framework; 34using OpenSim.Framework;
36using System.Data.SqlClient; 35using Npgsql;
36using NpgsqlTypes;
37 37
38namespace OpenSim.Data.MSSQL 38
39namespace 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)