David and Solomon are often seen as types of the Lord Jesus, but in profoundly different ways. Both were flawed types, and no type can ever fulfill the fullness and glory of Christ!
The Lord promised David that He would build him a house - that is, that God would establish David's throne forever. He promised David that of his seed, of his sons, would come forth one whose kingdom would be established.
That son would build God a house; God would establish his throne forever; God would be his father, and he would be God's son; and God would not take away His mercy from him.
Solomon fulfilled some of the promise, but only the Lord Jesus fulfills the promise of God to David perfectly. His throne is established forever; He is the adorable Son of God the Father from eternity and to everlasting; He will build an house unto God - His Church.
Solomon turned away from the Lord in his later years; still, God's mercy never departed from him.
Hundreds of years later, when it was clear Solomon was not the full satisfaction of God's promise, the prophet Isaiah foretold the coming of Messiah. He made it clear that the promised son would be God incarnate in the flesh, and that He would reign forever in an infinite kingdom with perfect peace and righteousness.
Hebrews confirms that God's promise to David applies to the Lord Jesus Himself.
But when the Savior appeared, the world despised Him and the Jewish rulers sought to destroy Him. Even today, Jewish people stumble at the cross - for how could the glorious son promised to David suffer such shame?
Yet Jesus had to suffer the cross if He were to reconcile His people to His perfect rule, making us fit for it.