A prayer of King David is recorded in 1 Chronicles 29:10-11; David prayed this prayer on the occasion when he was refused permission to build the temple but was allowed to collect resources for its construction.
This prayer, known by its Hebrew name Vayivarech David, is recited during the morning prayers— the Shacharit.
“Wherefore David blessed the LORD before all the congregation: and David said, Blessed be thou, O LORD, the God of Israel our father, for ever and ever. Thine, O LORD, is the greatness, and the power, and the glory, and the victory, and the majesty: for all that is in the heaven and in the earth is thine; thine is the kingdom, O LORD, and thou art exalted as head above all.” (1 Chronicles 29:10–11 RV)