コード例 #1
0
ファイル: MysqlDataUpdater.cs プロジェクト: heran/DReAM
 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();
 }
コード例 #2
0
ファイル: MysqlDataUpdater.cs プロジェクト: heran/DReAM
        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();
        }
コード例 #3
0
ファイル: MysqlDataUpdater.cs プロジェクト: sdether/DReAM
        //--- 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();
        }
コード例 #4
0
        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();
        }
コード例 #5
0
ファイル: DekiSocialService.cs プロジェクト: heran/DekiWiki
        //--- Methods ---
        protected override Yield Start(XDoc config, Result result) {
            yield return Coroutine.Invoke(base.Start, config, new Result());

            // read configuration settings
            _factory = new DataFactory(MySql.Data.MySqlClient.MySqlClientFactory.Instance, "?");
            _catalog = new DataCatalog(_factory, config);
            _domain = (config["openid-suffix"].AsText ?? string.Empty).ToLowerInvariant();

            // test database connection
            try {
                _catalog.TestConnection();
            } catch(Exception) {
                throw new Exception(string.Format("Unable to connect to Deki Social instance with connectionString: {0}", _catalog.ConnectionString));
            }
            result.Return();
        }
コード例 #6
0
ファイル: VBulletinService.cs プロジェクト: heran/DekiWiki
        //--- Methods ---
        protected override Yield Start(XDoc config, Result result) {
            yield return Coroutine.Invoke(base.Start, config, new Result());

            // read configuration settings
            _factory = new DataFactory(MySql.Data.MySqlClient.MySqlClientFactory.Instance, "?");
            _catalog = new DataCatalog(_factory, config);

            _tablePrefix = config["db-tableprefix"].AsText ?? string.Empty;

            // test database connection
            try {
                _catalog.TestConnection();
            } catch(Exception) {
                throw new Exception(string.Format("Unable to connect to vBulletin instance with connection string: {0}", _catalog.ConnectionString));
            }
            result.Return();
        }
コード例 #7
0
ファイル: MysqlDataUpdater.cs プロジェクト: heran/DReAM
        //--- 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();
        }
コード例 #8
0
ファイル: MysqlDataUpdater.cs プロジェクト: heran/DReAM
        //--- 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();
        }
コード例 #9
0
 //--- Methods---
 public override void TestConnection()
 {
     _dataCatalog.TestConnection();
 }
コード例 #10
0
ファイル: JoomlaService.cs プロジェクト: heran/DekiWiki
        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();
        }