For semiconductors at least, a good address:
http://www.ioffe.ru/SVA/NSM/Semicond/Then, be wary that bandgaps are accurately known (at least for the materials where it matters, which are semiconductors), but electron affinities aren't at all: discrepancies of 1eV are common. Electron affinity is difficult to measure, as it requires ultra-clean surfaces that last for a short time even in ultra vacuum.
As well, electron affinity depends a lot on crystal orientation, even for metals.
I doubt the conduction band of TiO2 is 3eV ABOVE vacuum. It might have happened to be 3eV above some Fermi level when the measurement was made, but then the Fermi level fluctuates anywhere between both bands in an insulator or a semiconductor.
More: if you need them to compute a contact between different materials, be aware that the interface (contamination and so on) determines what happens, not the bulk properties of both materials. Any prediction based on band properties would be very false.
Well, in short: do not believe electron affinity nor absolute band position, they use to be very false.