static Connection getConnection() throws DaoConnectException {
        checkPool();

        Connection conn = null;
        try {
            conn = queue.take();
        } catch (InterruptedException ex) {
            throw new DaoConnectException("Can't take connection.", ex);
        }
        try {
            if (conn == null || !conn.isValid(DB_ISVALID_TIMEOUT)) {
                throw new DaoConnectException("Taken from pool connection null or unvalid.");
            }
        } catch (SQLException ex) {
            throw new DaoConnectException("Error in check valid connection.", ex);
        }
        return conn;
    }