The prayer of David is based on and a response to the promise of God. He has courage to ask the Lord to establish his house because the Lord has revealed to David that this is his intention. In this, David shows us a godly and biblical pattern for prayer.1 We are to pray and speak to God in accordance with what he has revealed (see also Matthew 6:9–13).
27 For you, O LORD of hosts, the God of Israel, have made this revelation to your servant, saying, ‘I will build you a house.’ Therefore your servant has found courage to pray this prayer to you.