12 Thus then did the Prophet comfort him, but the blessed David, for all he heard it said, The Lord has put away your sin, did not cease from repentance, king though he was, but put on sackcloth instead of purple, and instead of a golden throne, he sat, a king, in ashes on the ground; nay, not only sat in ashes, but also had ashes for his food, even as he says himself, I have eaten ashes as it were bread. His lustful eye he wasted away with tears saying, Every night will I wash my couch, and water my bed with my tears. When his officers besought him to eat bread he would not listen. He prolonged his fast unto seven whole days. If a king thus made confession ought not thou, a private person, to confess? Again, after Absalom's insurrection, though there were many roads for him to escape, he chose to flee by the Mount of Olives, in thought, as it were, invoking the Redeemer who was to go up thence into the heavens. And when Shimei cursed him bitterly, he said, Let him alone, for he knew that “to him that forgives it shall be forgiven.”
Source: Catechetical Lectures (New Advent)