Of course God wants an intimate relationship with us. That is another very important aspect of prayer. However, our prayer doesn't change His Mind. Did it change His Mind in David's case?
Now I know the classic example of God changing His Mind over fasting, prayer and repentance is Jonah, but I think we need to look closely at the text.
Jonah 4:4 But it displeased Jonah exceedingly, and he became angry. 2 So he prayed to the Lord, and said, “Ah, Lord, was not this what I said when I was still in my country? Therefore I fled previously to Tarshish; for I know that You are a gracious and merciful God, slow to anger and abundant in lovingkindness, One who relents from doing harm.
Jonah KNEW God was gonna spare Nineveh. That's exactly WHY he didn't want to deliver the message to them. The Assyrians were brutal and had destroyed the Northern Kingdom. Torturing and enslaving many Jews. THAT'S why Jonah didn't want to go.
God explained to him pretty well what He thought of Jonah's lack of desire to fulfill His Plan in the belly of a whale!