I went though about 4 O2 sensors (from Autozone, Bosch brand) for a while. They just kept failing after about 1 week each time. Finally, my "rear" O2 stayed functional, and my front one went again. I brought it to a shop and the mechanic told me that he has always had issues with aftermarket O2 sensors, and would recommend trying an OEM instead. (This problem is more common on GM cars, apparently...)
So, he replaced with the OEM, and cleaned contacts and checked wiring. Everything was ok, and sure enough I have no more O2 codes since then (about 1 year ago).
Granted, many people here have had good luck with the Bosch O2 sensors... maybe I just had a bad spat of them.
I have heard that you should be careful when using "contact cleaners" on the connectors, though. Apparently, there have been cases where the vapors/cleaning fluid "wicks up" the conductor wires (under the insulation) and can toast the O2 sensor. Seems a bit far-fetched, but I have heard it from a few different sources....