Connect() public méthode

public Connect ( string hostIp, int hostPortNo, string charSet, string dbName, string user, string pwd, int commandTimeoutSec = 60 ) : void
hostIp string
hostPortNo int
charSet string
dbName string
user string
pwd string
commandTimeoutSec int
Résultat void
        public void Initialize(String ipAddress, Int32 portNo, String charSet, String dbName, String userId, String userPwd)
        {
            if (_cancelTasks != null)
                throw new AegisException(AegisResult.AlreadyInitialized);


            //  Connection Test
            try
            {
                DBConnector dbc = new DBConnector();
                dbc.Connect(ipAddress, portNo, charSet, dbName, userId, userPwd);
                dbc.Close();
            }
            catch (Exception e)
            {
                throw new AegisException(AegisResult.MySqlConnectionFailed, e, "Invalid MySQL connection.");
            }


            IpAddress = ipAddress;
            PortNo = portNo;
            CharSet = charSet;
            DBName = dbName;
            UserId = userId;
            UserPwd = userPwd;


            _cancelTasks = new CancellationTokenSource();
            PingTest();
        }
        public void Initialize(string ipAddress, int portNo, string charSet, string dbName, string userId, string userPwd)
        {
            if (_cancelTasks != null)
            {
                throw new AegisException(AegisResult.AlreadyInitialized);
            }


            //  Connection Test
            try
            {
                DBConnector dbc = new DBConnector();
                dbc.Connect(ipAddress, portNo, charSet, dbName, userId, userPwd);
                dbc.Close();
            }
            catch (Exception e)
            {
                throw new AegisException(AegisResult.MySqlConnectionFailed, e, "Invalid MySQL connection.");
            }


            IpAddress = ipAddress;
            PortNo    = portNo;
            CharSet   = charSet;
            DBName    = dbName;
            UserId    = userId;
            UserPwd   = userPwd;


            _cancelTasks = new CancellationTokenSource();
            PingTest();
        }
        public void IncreasePool(Int32 count)
        {
            while (count-- > 0)
            {
                DBConnector dbc = new DBConnector();
                dbc.Connect(IpAddress, PortNo, CharSet, DBName, UserId, UserPwd);


                using (_lock.WriterLock)
                {
                    _listPoolDBC.Add(dbc);
                }
            }
        }
        public void IncreasePool(int count)
        {
            int remain = _maxDBCCount - (PooledDBCCount + ActiveDBCCount);

            count = (new Calculate.MinMaxValue <int>(remain, count)).Min;

            while (count-- > 0)
            {
                DBConnector dbc = new DBConnector();
                dbc.Connect(IpAddress, PortNo, CharSet, DBName, UserId, UserPwd);

                _dbConnectors.Add(dbc);
                _poolDBC.Enqueue(dbc);
            }
        }
        internal DBConnector GetDBC()
        {
            lock (this)
            {
                if (_poolDBC.Count == 0 &&
                    PooledDBCCount + ActiveDBCCount < _maxDBCCount)
                {
                    var dbc = new DBConnector();
                    dbc.Connect(IpAddress, PortNo, CharSet, DBName, UserId, UserPwd);
                    _poolDBC.Enqueue(dbc);
                }
            }


            return(_poolDBC.Dequeue());
        }
        internal DBConnector GetDBC()
        {
            DBConnector dbc;


            using (_lock.WriterLock)
            {
                if (_listPoolDBC.Count == 0)
                {
                    dbc = new DBConnector();
                    dbc.Connect(IpAddress, PortNo, CharSet, DBName, UserId, UserPwd);
                }
                else
                {
                    dbc = _listPoolDBC.ElementAt(0);
                    _listPoolDBC.RemoveAt(0);
                    _listActiveDBC.Add(dbc);
                }
            }

            return(dbc);
        }
        internal DBConnector GetDBC()
        {
            DBConnector dbc;


            using (_lock.WriterLock)
            {
                if (_listPoolDBC.Count == 0)
                {
                    dbc = new DBConnector();
                    dbc.Connect(IpAddress, PortNo, CharSet, DBName, UserId, UserPwd);
                }
                else
                {
                    dbc = _listPoolDBC.ElementAt(0);
                    _listPoolDBC.RemoveAt(0);
                    _listActiveDBC.Add(dbc);
                }
            }

            return dbc;
        }
        public void IncreasePool(Int32 count)
        {
            while (count-- > 0)
            {
                DBConnector dbc = new DBConnector();
                dbc.Connect(IpAddress, PortNo, CharSet, DBName, UserId, UserPwd);


                using (_lock.WriterLock)
                {
                    _listPoolDBC.Add(dbc);
                }
            }
        }
        internal DBConnector GetDBC()
        {
            lock (this)
            {
                if (_poolDBC.Count == 0 &&
                    PooledDBCCount + ActiveDBCCount < _maxDBCCount)
                {
                    var dbc = new DBConnector();
                    dbc.Connect(IpAddress, PortNo, CharSet, DBName, UserId, UserPwd);
                    _poolDBC.Enqueue(dbc);
                }
            }


            return _poolDBC.Dequeue();
        }
        public void IncreasePool(int count)
        {
            while (count-- > 0)
            {
                DBConnector dbc = new DBConnector();
                dbc.Connect(IpAddress, PortNo, CharSet, DBName, UserId, UserPwd);


                _poolDBC.Enqueue(dbc);
            }
        }