12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Data;
- using OpenMetaverse;
- using OpenSim.Framework;
- using MySql.Data.MySqlClient;
- namespace OpenSim.Data.MySQL
- {
-
-
-
- public class MySqlFramework
- {
- private static readonly log4net.ILog m_log =
- log4net.LogManager.GetLogger(
- System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
- protected string m_connectionString;
- protected object m_dbLock = new object();
- protected MySqlFramework(string connectionString)
- {
- m_connectionString = connectionString;
- }
-
-
-
-
-
- protected int ExecuteNonQuery(MySqlCommand cmd)
- {
- lock (m_dbLock)
- {
- using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
- {
- dbcon.Open();
- cmd.Connection = dbcon;
- try
- {
- return cmd.ExecuteNonQuery();
- }
- catch (Exception e)
- {
- m_log.Error(e.Message, e);
- return 0;
- }
- }
- }
- }
- }
- }
|