5:4-6 David was aware that the One whom he petitioned was absolutely upright. Consequently those who are boastful and presumptuous cannot count on standing before Him and finding favor in His eyes. God hates and destroys liars, deceivers, and murderers.
5:7 David did not claim a right to stand before God and to present his petitions on the basis of his own righteousness. He believed God would be merciful to him because God had made promises to bless David and his house (2 Sam. 7). The king believed God would be loyal to His servant. "Lovingkindness"(NASB) or "mercy"(NIV) really means "loyal love"(Heb. hesed). The house and temple in view refer to the tabernacle David had pitched in Jerusalem for the ark (2 Sam. 6:17; cf. 1 Sam. 1:7, 9). Rather than behaving arrogantly like the wicked, David prostrated himself before the Lord in worship. This posture expressed an attitude of humility and vulnerability in God's presence.