1 Kings 5:3

Thou knowest how that David my father could not build an house unto the name of the Lord his God for the wars which were about him on every side, until the Lord put them under the soles of his feet.

Cross-reference

1 Kings 3:2 Historical context

1 Kings 3:2 explains that the lack of a temple led to high place worship, complementing the reason David could not build.

1 Kings 8:19 Prophetic fulfillment

1 Kings 8:19 recalls God's promise that David's son would build the temple, which Solomon now states was prevented by war.

In 2 Samuel 7:5-11, God promises to subdue David's enemies, which is the reason Solomon cites for David not building the temple.

In 1 Chronicles 22:8, God directly tells David his wars disqualify him from building the temple, the explicit basis for this verse.

In 1 Chronicles 28:3, David publicly states God's prohibition due to his warring, confirming the reason here.

In 2 Chronicles 6:6-8, Solomon himself repeats this explanation about David's wars at the temple dedication.

1 Chronicles 22:19 records David charging Solomon to build the temple, contrasting with the wars that prevented David himself.

2 Chronicles 6:7 notes David's heart to build the temple, providing the backstory for why Solomon now explains the delay.