Solomon concludes his great prayer by pleading with God to accept his requests through the merit of his father, David. He asks God not to turn him away empty-handed or withhold any good, but rather to accept everything he has just prayed for [רש״י, רד ק ומצודת דוד]. He refers to himself as God's anointed, a title that points primarily to his own status as the one chosen by God and physically anointed with oil to serve as king [רלב ג וביאור שטיינזלץ]. However, a Midrashic tradition suggests that this plea also hints at David. According to this view, David's coffin was brought to the Temple at that exact time, and in that spiritual moment, David was considered alive [חומת אנך].
Solomon asks God to act favorably because of David's righteous deeds and acts of kindness [מצודת דוד]. David's actions and intentions throughout his life were characterized by complete perfection, with the sole exception of his sin involving Uriah the Hittite. It was the overwhelming strength of David's piety and righteousness in all other areas of his life that ultimately protected him. Because of this lifelong devotion, God overlooked his sin and chose not to punish Him with the full severity it might have otherwise warranted [רלב״ג].
This moment carries profound dramatic weight in Rabbinic tradition. When Solomon attempted to bring the Ark of the Covenant into the Holy of Holies, the gates of the Temple mysteriously locked together and refused to open. Solomon offered twenty-four different prayers, but none were answered. It was only when he invoked the merit of his father's kindnesses that the gates finally swung open. At that precise moment, the faces of David's enemies darkened with shame, and the entire nation knew with absolute certainty that God had completely forgiven David for his past sin [חומת אנך].