According to the following passage
“And David took more concubines and wives from Jerusalem, after he came from Hebron, and more sons and daughters were born to David. And these are the names of those who were born to him in Jerusalem: Shammua, Shobab, Nathan, Solomon,” 2 Samuel 5:13-14
David had a son named Nathan
According to Luke’s account of Mary’s lineage - through which Jesus was to be born - it goes back to David but not through Solomon
“the son of Melea, the son of Menna, the son of Mattatha, the son of Nathan, the son of David, the son of Jesse, the son of Obed, the son of Boaz, the son of Sala, the son of Nahshon,” Luke 3:31-32
How does that play into the different promises made to David?
“then I will establish your royal throne over Israel forever, as I promised David your father, saying, ‘You shall not lack a man on the throne of Israel.’” 1 Kings 9:5
Would this mean the promise was for David guaranteed and any of his descendants but not also true for Solomon?
And does it fulfill the prophetic awaited prophecy of the Messiah being from the Davidic lineage even if He was not from the line of Solomon and therefore all previous kings?
“There shall come forth a shoot from the stump of Jesse, and a branch from his roots shall bear fruit.” Isaiah 11:1
And more explicitly
“For to us a child is born, to us a son is given; and the government shall be upon his shoulder, and his name shall be called Wonderful Counselor, Mighty God, Everlasting Father, Prince of Peace. Of the increase of his government and of peace there will be no end, on the throne of David and over his kingdom, to establish it and to uphold it with justice and with righteousness from this time forth and forevermore. The zeal of the Lord of hosts will do this.” Isaiah 9:6-7