Iwillestablishhisthroneforever - David was a type of Christ; and concerning him the prophecy is literally true. See Isaiah 9:7, where there is evidently the same reference.
SDA Bible Commentary (limited)
Volume 1-7
12. He shall build. Solomon fulfilled this prediction when he erected the Temple to be the symbolic earthly dwelling place of God (see 1 Kings 8:20, 44; 9:1, 3).
For ever. This promise was conditional on obedience (ch.28:6, 7). Because of human failure the promise will ultimately be fulfilled only through Christ and the church (see Luke 1:32, 33; see on 2 Sam. 7:13).