public void ChangeDatabase(string server, int port, string dbname, string dbuser, string dbpassword, uint timeout) { var dataFactory = new DataFactory("MySql.Data", "?"); var connectionString = BuildConnectionString(server, port, dbname, dbuser, dbpassword, timeout); _dataCatalog = new DataCatalog(dataFactory, connectionString); _dataCatalog.TestConnection(); }
//--- Constructors --- public MysqlDataUpdater(string server, int port, string dbname, string dbuser, string dbpassword, string version) { _effectiveVersion = new VersionInfo(version); if(!_effectiveVersion.IsValid) { throw new VersionInfoException(_effectiveVersion); } // initialize the data catalog var dataFactory = new DataFactory("MySql.Data", "?"); var connectionString = BuildConnectionString(server, port, dbname, dbuser, dbpassword); _dataCatalog = new DataCatalog(dataFactory, connectionString); _dataCatalog.TestConnection(); }
protected override Yield Start(XDoc config, Result result) { yield return Coroutine.Invoke(base.Start, config, new Result()); _factory = new DataFactory(MySql.Data.MySqlClient.MySqlClientFactory.Instance, "?"); _catalog = new DataCatalog(_factory, config); _prefix = config["db-tableprefix"].AsText ?? "jos_"; try { _catalog.TestConnection(); } catch(Exception) { throw new Exception(string.Format("Unable to connect to joomla instance with connectionString: {0}", _catalog.ConnectionString)); } result.Return(); }
//--- Constructors --- public MysqlDataUpdater(string server, int port, string dbname, string dbuser, string dbpassword, string version, uint timeout) { if(string.IsNullOrEmpty(version)) { _targetVersion = null; } else { _targetVersion = new VersionInfo(version); if(!_targetVersion.IsValid) { throw new VersionInfoException(_targetVersion); } } // initialize the data catalog var dataFactory = new DataFactory("MySql.Data", "?"); var connectionString = BuildConnectionString(server, port, dbname, dbuser, dbpassword, timeout); _dataCatalog = new DataCatalog(dataFactory, connectionString); _dataCatalog.TestConnection(); }
protected override Yield Start(XDoc config, Result result) { yield return Coroutine.Invoke(base.Start, config, new Result()); _factory = new DataFactory(MySql.Data.MySqlClient.MySqlClientFactory.Instance, "?"); _catalog = new DataCatalog(_factory, config); _prefix = config["db-tableprefix"].AsText ?? "jos_"; _version = config["joomla-version"].AsText; if (_version == null) _version = "1.6"; else if (_version != "1.0" && _version != "1.5" && _version != "1.6") { _log.Warn("joomla-version is set incorrectly: " + _version + ". Should be one of the following: 1.0, 1.5, 1.6"); _version = "1.6"; } try { _catalog.TestConnection(); } catch(Exception) { throw new Exception(string.Format("Unable to connect to joomla instance with connectionString: {0}", _catalog.ConnectionString)); } result.Return(); }
//--- Constructors --- public MySqlPageSubscriptionSessionFactory(XDoc config) { _config = config; var catalog = config["db-catalog"].AsText; _log.DebugFormat("created MySqlPageSubscriptionSessionFactory for catalog '{0}'", catalog); _dataFactory = new DataFactory(MySqlClientFactory.Instance, "?"); }
public void Initialize(XDoc config, XDoc license, IInstanceSettings instanceSettings) { _dataFactory = new DataFactory(MySqlClientFactory.Instance, "?"); _config = config; _instanceSettings = instanceSettings; }