示例#1
0
        public IQueryAdapter getQueryreactor()
        {
            IDatabaseClient dbClient = null;

            lock (connections.SyncRoot)
            {
                if (connections.Count > 0)
                {
                    dbClient = (IDatabaseClient)connections.Dequeue();
                }
            }

            if (dbClient != null)
            {
                dbClient.connect();
                dbClient.prepare();
                return(dbClient.getQueryReactor());
            }
            else
            {
                if (type == DatabaseType.MySQL)
                {
                    IDatabaseClient connection = new MySqlClient(this, 0);
                    connection.connect();
                    connection.prepare();
                    return(connection.getQueryReactor());
                }
                else
                {
                    IDatabaseClient connection = new MsSQLClient(this, 0);
                    connection.connect();
                    connection.prepare();
                    return(connection.getQueryReactor());
                }
            }
        }
示例#2
0
        public IQueryAdapter getQueryreactor()
        {
            IDatabaseClient dbClient = null;
            lock (connections.SyncRoot)
            {
                if (connections.Count > 0)
                {
                    dbClient = (IDatabaseClient)connections.Dequeue();
                }
            }

            if (dbClient != null)
            {
                dbClient.connect();
                dbClient.prepare();
                return dbClient.getQueryReactor();
            }
            else
            {
                if (type == DatabaseType.MySQL)
                {
                    IDatabaseClient connection = new MySqlClient(this, 0);
                    connection.connect();
                    connection.prepare();
                    return connection.getQueryReactor();
                }
                else
                {
                    IDatabaseClient connection = new MsSQLClient(this, 0);
                    connection.connect();
                    connection.prepare();
                    return connection.getQueryReactor();
                }
            }
        }