  We study Andreev bound states and $\pi $-junction transition in a
superconductor / quantum-dot / superconductor (S-QD-S) system by Green function
method. We derive an equation to describe the Andreev bound states in S-QD-S
system, and provide a unified understanding of the $\pi $-junction transition
caused by three different mechanisms: (1) {\it Zeeman splitting.} For QD with
two spin levels $E_{\uparrow}$ and $E_{\downarrow}$, we find that the surface
of the Josephson current $I(\phi =\frac \pi 2)$ vs the configuration of
$(E_{\uparrow},E_{\downarrow})$ exhibits interesting profile: a sharp peak
around $E_{\uparrow}=E_{\downarrow}=0$; a positive ridge in the region of
$E_{\uparrow}\cdot E_{\downarrow}>0$; and a {\em % negative}, flat, shallow
plain in the region of $E_{\uparrow}\cdot E_{\downarrow}<0$. (2){\it \
Intra-dot interaction.} We deal with the intra-dot Coulomb interaction by
Hartree-Fock approximation, and find that the system behaves as a $\pi
$-junction when QD becomes a magnetic dot due to the interaction. The
conditions for $\pi $-junction transition are also discussed. (3) {\it \
Non-equilibrium distribution.} We replace the Fermi distribution $f(\omega)$ by
a non-equilibrium one $\frac 12[ f(\omega -V_c)+f(\omega +V_c)] $, and allow
Zeeman splitting in QD where $% E_{\uparrow}=-E_{\downarrow}=h.$ The curves of
$I(\phi =\frac \pi 2)$ vs $% V_c$ show the novel effect of interplay of
non-equilibrium distribution with magnetization in QD.
