A practical protocol is proposed for realizing Deutsh-Jozsa algorithm in cavity QED.The scheme does not require the transfer of quantum information between the atoms and cavity.In the scheme the cavity is only virtually excited,so the requirement on the quality of the cavity is greatly loosened.