David knew about God's promises. he understood that his Kingship included his people as well, solidarity with his people. That principle of solidarity moves across time to include us and every human that is born of Adam. Jesus was the final Davidic King, but he was without sin. If you believe in him, you will share in the resurrection, his glory and his rule.
I Will Sing of the Steadfast Love of the Lord
A Maskil[a] of Ethan the Ezrahite.
1 I will sing of the steadfast love of the Lord, forever; with my mouth I will make known your faithfulness to all generations. 2 For I said, “Steadfast love will be built up forever; in the heavens you will establish your faithfulness.” 3 You have said, “I have made a covenant with my chosen one; I have sworn to David my servant: 4 ‘I will establish your offspring forever, and build your throne for all generations.’” Selah
5 Let the heavens praise your wonders, O Lord, your faithfulness in the assembly of the holy ones! 6 For who in the skies can be compared to the Lord? Who among the heavenly beings[b] is like the Lord, 7 a God greatly to be feared in the council of the holy ones, and awesome above all who are around him? 8 O Lord God of hosts, who is mighty as you are, O Lord, with your faithfulness all around you? 9 You rule the raging of the sea; when its waves rise, you still them. 10 You crushed Rahab like a carcass; you scattered your enemies with your mighty arm. 11 The heavens are yours; the earth also is yours; the world and all that is in it, you have founded them. 12 The north and the south, you have created them; Tabor and Hermon joyously praise your name. 13 You have a mighty arm; strong is your hand, high your right hand. 14 Righteousness and justice are the foundation of your throne; steadfast love and faithfulness go before you. 15 Blessed are the people who know the festal shout, who walk, O Lord, in the light of your face, 16 who exult in your name all the day and in your righteousness are exalted. 17 For you are the glory of their strength; by your favor our horn is exalted. 18 For our shield belongs to the Lord, our king to the Holy One of Israel.
19 Of old you spoke in a vision to your godly one,[c] and said: “I have granted help to one who is mighty; I have exalted one chosen from the people. 20 I have found David, my servant; with my holy oil I have anointed him, 21 so that my hand shall be established with him; my arm also shall strengthen him. 22 The enemy shall not outwit him; the wicked shall not humble him. 23 I will crush his foes before him and strike down those who hate him. 24 My faithfulness and my steadfast love shall be with him, and in my name shall his horn be exalted. 25 I will set his hand on the sea and his right hand on the rivers. 26 He shall cry to me, ‘You are my Father, my God, and the Rock of my salvation.’ 27 And I will make him the firstborn, the highest of the kings of the earth. 28 My steadfast love I will keep for him forever, and my covenant will stand firm[d] for him. 29 I will establish his offspring forever and his throne as the days of the heavens. 30 If his children forsake my law and do not walk according to my rules,[e] 31 if they violate my statutes and do not keep my commandments, 32 then I will punish their transgression with the rod and their iniquity with stripes, 33 but I will not remove from him my steadfast love or be false to my faithfulness. 34 I will not violate my covenant or alter the word that went forth from my lips. 35 Once for all I have sworn by my holiness; I will not lie to David. 36 His offspring shall endure forever, his throne as long as the sun before me. 37 Like the moon it shall be established forever, a faithful witness in the skies.” Selah
38 But now you have cast off and rejected; you are full of wrath against your anointed. 39 You have renounced the covenant with your servant; you have defiled his crown in the dust. 40 You have breached all his walls; you have laid his strongholds in ruins. 41 All who pass by plunder him; he has become the scorn of his neighbors. 42 You have exalted the right hand of his foes; you have made all his enemies rejoice. 43 You have also turned back the edge of his sword, and you have not made him stand in battle. 44 You have made his splendor to cease and cast his throne to the ground. 45 You have cut short the days of his youth; you have covered him with shame. Selah
46 How long, O Lord? Will you hide yourself forever? How long will your wrath burn like fire? 47 Remember how short my time is! For what vanity you have created all the children of man! 48 What man can live and never see death? Who can deliver his soul from the power of Sheol? Selah
49 Lord, where is your steadfast love of old, which by your faithfulness you swore to David? 50 Remember, O Lord, how your servants are mocked, and how I bear in my heart the insults[f] of all the many nations, 51 with which your enemies mock, O Lord, with which they mock the footsteps of your anointed.
52 Blessed be the Lord forever! Amen and Amen.