2 Samuel 7:11-16 (ESV)
11 from the time that I appointed judges over my people Israel. And I will give you rest from all your enemies. Moreover, the LORD declares to you that the LORD will make you a house. 12 When your days are fulfilled and you lie down with your fathers, I will raise up your offspring after you, who shall come from your body, and I will establish his kingdom. 13 He shall build a house for my name, and I will establish the throne of his kingdom forever. 14 I will be to him a father, and he shall be to me a son. When he commits iniquity, I will discipline him with the rod of men, with the stripes of the sons of men, 15 but my steadfast love will not depart from him, as I took it from Saul, whom I put away from before you. 16 And your house and your kingdom shall be made sure forever before me. Your throne shall be established forever.'"
It doesn't seem that it can be just Solomon since Solomon's kingdom didn't last forever. It also doesn't seem like it can be a reference to the Messiah/Jesus because this bit doesn't fit with what I know of the Christians believe that Jesus, being God, could not do wrong:
2 Samuel 7:14 (ESV)
14 I will be to him a father, and he shall be to me a son. When he commits iniquity, I will discipline him with the rod of men, with the stripes of the sons of men,
So who is being referred to in this passage?