In a commutative unital ring, if a prime ideal contains a product of ideals then it contains one of the factors

Let $R$ be a commutative ring with $1 \neq 0$. Let $I,J,P \subseteq R$ be ideals, and let $P$ be prime in $R$. Suppose further that $IJ \subseteq P$. Prove that either $I \subseteq P$ or $J \subseteq P$.

Suppose $I \not\subseteq P$. Then there exists $a \in I$ such that $a \notin P$. Now let $b \in J$. Since $IJ \subseteq P$, $ab \in P$. Since $P$ is a prime ideal and $a \notin P$, we have $b \in P$. Since $b$ was arbitrary in $J$, $J \subseteq P$.