Code 12: Battery has been disconnected causing some learned values to be lost.
Code 21: Front or Rear oxygen sensor signal voltage was either too low indicating a short to ground or too high indicating a short to voltage.
Given these two codes it sounds like denisond3 has the right of it. Definately check that wiring harness.
Good Luck