2 Samuel 7:12
And when thy days be fulfilled, and thou shalt sleep with thy fathers, I will set up thy seed after thee, which shall proceed out of thy bowels, and I will establish his kingdom. And when thy days be fulfilled, and thou shalt sleep with thy fathers, I will set up thy seed after thee, which shall proceed out of thy bowels, and I will establish his kingdom.
The promise was given when David was dwelling in his palace of cedar while the ark of God remained in the curtained tabernacle with the divine presence between the cherubim, and, filled with remorse and desiring a more honorable place for worship, David made his purpose to build a temple known to Nathan the prophet, who encouraged him to carry it out. God declined David's good desire to build Him a house, for that was not His plan for David, and David was not permitted to build, but God in His providence selected David's son Solomon to build Him a house in Jerusalem, who would build the temple and reign in peace. That refusal did not mean David's devotion was rejected, for God instead promised to make David a lasting house through his posterity, to bless and use him, to show him love, and to entrust him with another service. The verse promises that when David's days are fulfilled and he sleeps with his fathers, God will raise up his seed proceeding out of his own body to succeed him and will establish his kingdom, and in its immediate sense this is Solomon, born of David's line.
The larger promise assures that if Solomon sinned God would discipline him, yet would not withdraw mercy from him as He had withdrawn it from Saul. The verse ultimately foretells the Messiah as David's promised heir and King on David's throne, a descendant of David succeeding him with an established kingdom in human lineage. With an oath God promised to raise up Christ from the fruit of David's loins according to the flesh in direct lineage to the house of David. David as a prophet foresaw this and spoke of Christ's resurrection, fulfilled when God raised up and exalted Jesus by His right hand as both Lord and Christ.
The Jews misread this promise of Davidic kingship as a political deliverer who would come with pomp and ceremony as a great conqueror to defeat Rome, deliver Israel from the Roman yoke, and establish a temporal kingdom, confusing prophecies of Christ's second coming in power and glory with prophecies of His first advent in humility. Jesus is that promised Seed and Anointed One whose goings forth are from everlasting, yet He came in humiliation from humble family connections as the son of Joseph and Mary, seen toiling at the carpenter's bench as the King of glory in the form of a servant clothed in humanity. This humiliation was foretold as revealing His divine character and mission and should have commended Him to every home and heart, but to proud and unbelieving hearers it was an offense, so they questioned His Messiahship and rejected Him as the Prince of Life.