예제 #1
0
        private void addConnection(int id)
        {
            var item = new MySqlClient(this, id);

            item.connect();
            this.databaseClients.Add(item);
        }
예제 #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());
                }
            }
        }
예제 #3
0
 private void addConnection(int id)
 {
     MySqlClient item = new MySqlClient(this, id);
     item.connect();
     this.databaseClients.Add(item);
 }
예제 #4
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();
                }
            }
        }
예제 #5
0
 internal QueryAdapter(MySqlClient client)
 {
     this.client = client;
 }
예제 #6
0
 internal TransactionQueryReactor(MySqlClient client) : base(client)
 {
     this.initTransaction();
 }