This is the SDE for a geometric Brownian motion with time dependent volatility $\theta_t$.
It can be easily solved with the substitution
$$
X_t = \log Z_t =: f(Z_t).
$$
According to Ito's Lemma we have that
\begin{align}
dX_t &= d f(Z_t) = \frac{\partial f}{\partial z}(Z_t) \;d Z_t + \frac 12 \frac{\partial^2 f}{\partial z^2}(Z_t) \;\bigl(dZ_t \bigr)^2 = \\[2mm]
&= -\frac{1}{Z_t} Z_t \theta_t \; dB_t - \frac{1}{2} \frac{1}{\bigl(Z_t\bigr)^2} \bigl(Z_t \theta_t\bigr)^2 \; dt = \\[2mm]
&=-\theta_t \; dB_t - \frac 12 \theta_t^2 \; dt.
\end{align}
Therefore,
$$
X_t = X_0 - \int_0^t \theta_u \; dB_u - \frac 12 \int_0^t \theta_u^2 \; du,
$$
and the result follows by simply applying $\exp$ to both sides.