  We classify all tilting classes over an arbitrary commutative ring via
certain sequences of Thomason subsets of the spectrum, generalizing the
classification for noetherian commutative rings by
Angeleri-Posp\'i\v{s}il-\v{S}\v{t}ov\'i\v{c}ek-Trlifaj. We show that the
n-tilting classes can be equivalently expressed as classes of all modules
vanishing in the first n degrees of one of the following homology theories
arising from a finitely generated ideal: Tor_*(R/I,-), Koszul homology,
\v{C}ech homology, or local homology (even though in general none of those
theories coincide). Cofinite-type n-cotilting classes are described by
vanishing of the corresponding cohomology theories. For any cotilting class of
cofinite type, we also construct a corresponding cotilting module, generalizing
the construction of \v{S}\v{t}ov\'i\v{c}ek-Trlifaj-Herbera. Finally, we
characterize cotilting classes of cofinite type amongst the general ones, and
construct new examples of n-cotilting classes not of cofinite type, which are
in a sense hard to tell apart from those of cofinite type.
