// ===================================================== public static MySqlDbConnection getInstance(string uid = null, string password = null) // ===================================================== { if (_dbConnection == null) { Console.WriteLine("Using the MySql database."); _dbConnection = new MySqlDbConnection(uid, password); } return((MySqlDbConnection)_dbConnection); }
// ===================================================== public static DbConnection getInstance(string uid = null, string password = null) // ===================================================== { if (_dbConnection == null) { if (Server == DbConnection.Server.MySql) { _dbConnection = MySqlDbConnection.getInstance(); } else if (Server == DbConnection.Server.MongoDb) { _dbConnection = MongoDbConnection.getInstance(); } else { throw new HammerMainException("Error: DB Server unavailable."); } } return(_dbConnection); }