  Let $\Omega \subset \rr^2$ be a bounded simply connected domain. We show
that, for a fixed (every) $p\in (1,\fz),$ the divergence equation
$\mathrm{div}\,\mathbf{v}=f$ is solvable in $W^{1,p}_0(\Omega)^2$ for every
$f\in L^p_0(\Omega)$, if and only if $\Omega$ is a John domain, if and only if
the weighted Poincar\'e inequality $$\int_\Omega|u(x)-u_{\Omega}|^q\,dx\le
C\int_\Omega|\nabla u(x)|^q\dist(x,\partial \Omega)^q\,dx$$ holds for some
(every) $q\in [1,\fz)$. In higher dimensions similar results are proved under
some additional assumptions on the domain in question.
