Yes! David was huMan and when tempted fell and sought The face of God for forgiveness. God, The Creator said David would be an ancestor of eternal salvation.
Psalm 89:34-37 describes this as a perpetual covenant:
“My covenant I will not break, nor alter the word that has gone out of My lips. Once I have sworn by My holiness; I will not lie to David: his seed shall endure forever, and his throne as the sun before Me; it shall be established forever like the moon, even like the faithful witness in the sky.” Selah.
Beloved I pray with you:
May God defend you and save your life for His own names sake in Jesus’ name, Amen.