What David had was his “heart after God.” In 22:7-19, David has been told by God that he cannot build God’s house in Jerusalem because he is a man of war who has shed much blood. This is not as negative as it sounds: David’s wars were God’s plan for him, performed faithfully despite his human pratfalls.
I know in my own life, I have metaphorically “shed much blood” by working hard to “keep the lights on in America,” exactly as God called me to do, despite my own pratfalls. What has your life been about? Haven’t we have all lived according to God’s plan for us? But life in the “streets” is messy, isn’t it?
So God’s assignment of Solomon to build the Lord’s house was not a penalty placed on David, but an acknowledgment of passing the torch in perfect unity with God. David understood this and did everything in his power to enable it, exhausting every resource available to prepare all the materials for God’s house, which Solomon would ultimately build.
In Passage 2, David’s final act was to pass the torch to Solomon and to all the people of Israel in perfect unity with God. In his speech to the nation, David unknowingly revealed what he lacked. With intent to bow humbly before God on behalf of the nation, David acknowledged that all things come from God; but…
“Our days on the earth are like a shadow, and there is no abiding.”
The footnote in the ESV Bible defines “abiding” as having hope or prospect for success. David is telling his people to honor God because they will be gone in a flash without hope or prospects for success. How sad.
But David said this because he did not know Jesus yet (I am betting he does now)!
Contrast what Jesus says to you and me using the same word "abide" at the Last Supper, just before he goes to the cross for us, words that he likely considers to be among his most important:
“If you keep my commandments, you will abide in my love, just as I have kept my Father’s commandments and abide in his love. These things I have spoken to you, that my joy may be in you, and that your joy may be full.” 
Jesus teaches us to “abide” numerous times in this section of John 15, emphasizing its importance. So in my book Streamside – Finding Peace through Perfect Unity, I studied this word deeply in its original Greek. Its true meaning became the fundamental principle of perfect unity in the New Testament that drove me to this study of the Old Testament:
“Abiding” in Jesus is having “intense, enduring, personal communion” with Jesus.
Having what David lacked, we are blessed beyond measure if we practice it faithfully every hour of every day – abiding in Jesus with “IEPC”: intense, enduring, personal communion.
Elect a leader who believes this passionately and it will save a nation. Ignore it long enough and the opposite will occur.
 The Holy Bible: English Standard Version. (2001). (1 Ch 29:15). Wheaton: Standard Bible Society.
 The Holy Bible: English Standard Version. (2001). (Jn 15:10–11). Wheaton: Standard Bible Society.