# What are open immersions in terms of rings?

Suppose $A$ and $B$ are two commutative rings, and let $f:A\rightarrow B$ be a ring homomorphism. Suppose that the induced map on the spectra $f^*:Spec B\rightarrow Spec A$ is an open immersion. What does it say about $f$? does it follows that $f$ is a localization?

edit: Thanks for the answer! What about closed immersions? is this case simpler? Is it true that a closed immersion is always of the form $A\rightarrow A/I$ for some ideal $I$ in $A$?

-
The question about closed immersions is addressed in Hartshorne exercise II.2.18 –  solbap Jan 7 '11 at 19:05