private void clearClosedConnections() {
        new Thread() {
            @Override
            public void run() {
                while(true) {
                    synchronized(connections) {
                        Iterator<ConnectionData> it = connections.iterator();
                        while(it.hasNext()) {
                            ConnectionData cd = it.next();
                            if(cd.isClosed() || cd.getLastQueryTime() > 20 * DateUtil.MILLISECONDS_IN_SECOND) {
                                cd.close();
                                it.remove();
                                poolSize--;
                            }
                        }
                    }
                    try {
                        Thread.sleep(10 * DateUtil.MILLISECONDS_IN_SECOND);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        }.start();
    }