4. Given the power function $y=x^{m^{2}-m-6}(m \in \mathbf{Z})$ whose graph has no common points with the $x$-axis. Then the range of $m$ is ( ).
(A) $\{m \mid-2<m<3, m \in \mathbf{Z}\}$
(B) $\{m \mid-2 \leqslant m \leqslant 3, m \in \mathbf{Z}\}$
(C) $\{m \mid-3<m<2, m \in \mathbf{Z}\}$
(D) $\{m \mid-3 \leqslant m \leqslant 2, m \in \mathbf{Z}\}$
4.B.

The function $y=x^{m^{2}-m-6}(m \in \mathbf{Z})$ has no common points with the $x$-axis $\Leftrightarrow y$ is never zero $\Leftrightarrow$ the function $y$ is undefined at $x=0$. Therefore, $m^{2}-m-6 \leqslant 0$. Solving this, we get $-2 \leqslant m \leqslant 3$.