After David is spared from his enemies and given Kingship over those who were trying to subvert David, David declares that he will praise God forever:
Psa 18:49 For this, O LORD, I will praise you among the nations; I will sing praises to your name.
Psa 18:50 You give great victories to your king; you show unfailing love to your anointed, to David and all his descendants forever.
This is also paralleled in God’s Covenant with David, where God tells David that He will never leave David’s side, and assure he rules forever.
Jesus and David both came from the Israelite Tribe of Judah, Jesus was actually David’s earthly descendant and we are Christ’s children, we also benefit from God’s Covenant promises to David via Christ who died for our sin!