The words are David melech Israel khai ve-kayyam (David, king of Israel, is alive and well). They are taken from an incident related in the Babylonian Talmud (t. Rosh ha-Shanah 25a) regarding the blessing of the new moon. Rabbi Judah ha-Nasi sends R. Hiyya to bless the new moon and report back if all goes well by sending a signal containing the phrase "David, king of Israel, is alive and well."
The link between King David and the moon did not originate with R. Judah. It is found in Ps. 89:37-38. "His seed shall endure for ever, and his throne as the sun before Me. It shall be established for ever as the moon; and be steadfast as the witness in sky."
In early Judaism David was considered by many to still be alive, and that he would be the messiah. Others considered him more than a messiah, but a divine figure, if not a secondary god.
"One passage says: His throne was fiery flames (Dan. 7:9) and another
passage says: Until thrones were placed; and One that was ancient of days did sit - there is no contradiction; One (throne) for Him, and one for David:
this is the view of R. Akiba.
Said R. Jose the Galilean to him: 'Akiba, how long will you profane the Divine Presence [Shekhinah]!
Say rather, one for justice and one for mercy.'
Did he accept this from him, or did he not accept it? - come and hear: 'One for justice and one for mercy'; this is the view of R. Akiba."
-Babylonian Talmud, t. Hagigah 14a.
More on this controversy can be found in pg. 47-48 of Alan Segal's "Two Powers in Heaven" and in Daniel Boyarin's "Border Lines" pg. 140-145.
The following source should illustrate my point on David's role as a divine co-ruler with God.
Eleh Ezkerah, or the Midrash on the Ten Martyrs, was one of the most popular and influential texts in Judaism. it was composed in Geonic times, but based on several earlier traditions. The "Ten Martyrs" relates how the Roman emperor decreed that ten leading Jewish sages were to be seized and put to death. They were to be punished vicariously for the sin of their ten ancestors. They sold their brother Joseph into slavery, an act which Torah states is punishable by death.
Rabbi Nehunia ha-Qanah sends his disciple R. Ishmael on a heavenly ascent to
discover if the decree was decreed in heaven as well. If it were an earthly decree, then they could overturn it by their piety and mystical powers.
R. Ishmael discovers that God has allowed the decree to stand in order to fulfil the demands of justice, and in return for the deaths of the ten sages, Rome will be obliterated.
When R. Ishmael returns, the ten sages submit to the yoke of heaven and are cruelly executed by Rome.
Eleh Ezkerah is, historically-speaking, a jumbled mess. The ten martyrs did not all live and die at the same time, and the political and religious reality of life under the Byzantine Empire rubs shoulders with those of the Bar-Kochba Revolt and the Hadrianic persecutions.
What follows is part of the earlier Eleh Ezkerah material included in the mystical text Heichalot Rabbati.
Heichalot Rabbati, Apocalypse One, translated by Morton Smith. I ammended the translation slightly to better fit the biblical references in the original.
[Segansegael, the Prince of the Presence, said to R. Ishmael] “My friend, sit in my bosom and I shall tell thee what is to come upon Israel.”
I sat in his bosom and he gazed upon me and did weep, and his tears ran down continually from his eyes and fell upon my face.
I said to him, “Why does your Excellency weep?”
He said to me, “My friend, come, and I shall take thee in and teach thee what is laid up for Israel, the holy people.”
He grasped me by my hand and took me in to the inmost chambers and to the most secret rooms and to the treasuries. He took tablets and opened them and showed me letters written with griefs each different from the other.
I said to him, “For whom are these?” He said to me, “For Israel.”
I said to him, “And can Israel bear them?”
He said to me, “Come tomorrow and I shall teach thee of griefs yet different from these.” On the morrow he took me in to the inmost chambers and showed me griefs more bitter than the first: "Such as are for death, to death; and such as are for the sword, to the sword; and such as are for the famine, to the famine; and such as are for captivity, to captivity (Jer. 15:2)." I said to him, “And did then, your Excellency, Israel alone sin?”
He said to me, “Griefs more bitter than these are laid on them anew each day. And when, assembling in synagogues and schools, they say, ‘Amen. Let the great name be blessed,’ we do not permit these [griefs] to go forth from the inmost chambers.”
When I went down from before him I heard a voice speaking in the Aramaic language, and thus it said:
“The holy shrine shall be a ruin;
and the temple, a fire burning;
“And the dwelling of the king, desolation;
and she in whom the king rejoiced shall mourn as a widow;
“And the virgins and the youths shall be spoiled;
and the servants of the king, be killed;
“And the pure altar, polluted;
and the table which was set before the Lord, taken as spoil by the enemy;
“And Jerusalem shall be desolation;
and the land of Israel trembling.”
When I heard the voice of this vision I was terrified and struck silent and fell backwards. But then came the angel Hadariel and gave me breath and spirit and stood me upon my feet. He said to me, ”My friend, what came over thee?” I said to him, “Your Excellency, is there no restoration for Israel?”
He said to me, “Come, and I shall bring thee in to treasuries of consolations and to treasuries of salvations and shall show thee.” He brought me in to treasuries of salvations and to treasuries of consolations and I beheld the companies of ministering angels, that they were sitting and weaving garments of salvations and making crowns of life and fixing in them precious stones and pearls and compounding all manner of spices and perfumed wines for the righteous. And I beheld one crown which differed from all the [other] crowns, and the sun and the moon and the twelve signs of the zodiac were fixed in it. I said to him, “Your Excellency, for whom are these crowns?”
He said to me, “For Israel.”
“And that different crown, for whom is that destined?”
He said to me, “For David, the king of Israel.”
I said to him, “Your Excellency, show me the glory of David.”
He said to me, “My friend, wait for three hours until David cometh hither and thou shalt behold his greatness.”
He took me and seated me in his bosom.
He said to me, “What dost thou see?”
I said to him, “I see seven lightnings which strike as one.”
He said to me, “My son, close thine eyes that thou not be shaken by those that shall go forth to meet David.” At once, all ophanim and seraphim and the holy beasts and treasuries of snow and treasuries of hail and clouds of glory and planets and stars and ministering angels and fiery spirits of the fourth heaven cried out in tumult, saying: “For the chief musician, a psalm of David. The heavens are telling the glory of God (Ps. 19:1-2).”
And I heard a sound of a great uproar which came from Eden, saying: “The Lord shall reign forever and ever (Ex. 15:18).”
And behold David, the King of Israel, came first, and I beheld all the kings of the house of David following after him, and each had his crown on his head and the crown of David was more brilliant and differed from all the other crowns and its splendor went forth from one end of the world to the other.
When David went up to the great temple which is in the firmament, there was set for him a throne of fire which was forty parasangs in height and double in length and double in breadth.
And when David came and sat down upon his throne which was prepared for him opposite the throne of his Creator (and all the kings of the house of David sit before him, and all the kings of the house of Israel stand behind him) at once David arose and uttered songs and praises [such as] ear hath not heard from [the creation of] the world.
And when David began and said, “The Lord shall reign forever and ever!" Metatron and all his servants began and said, “Holy, holy, holy is the Lord of Hosts, all the earth is full of His glory (Isa. 6:3),” and the beasts praise God saying, “Blessed be the glory of the Lord from His [dwelling] place (Eze. 3:12),” and the firmaments say, “The Lord shall reign forever and ever,” and all the earth saith, “The Lord has been King (Ps. 93:1), the Lord is King (Ps. 10:16), the Lord shall be King, forever and ever (Ex. 15:18),” and all the kings of the house of David say, “The Lord shall be King over all the earth, in that day shall the Lord be one and His name One (Zech. 14:9).”
The angel Sagansegael (one of the titles of Metatron) weeps over the woes awaiting Israel. R. Ishmael leaves the treasury and hears a bath kol (a voice serving as heavenly oracle) reciting an Aramaic lament over Jerusalem and its temple. Aramaic, as shown by the Babylonian Talmud, t. Sotah 33a, served as a direct conduit of revelation between God (or his Shekhinah) and man. Aramaic bypassed the ministering angels, who only know Hebrew. R. Ishmael is overwhelmed by the horrific news until he is revived by an angel, who shows him a scene of consolation and salvation. The Revelation of St. John and the later, Gnostic "Dialogue of the Saviour" both have new garments given to God's people when salvation occurs, but the imagery can be found as early as Zechariah 3. Revelation 2:10 describes a crown (as do several other New Testament books) given to those that overcome.
While it can't be emphasised enough that crowns weren't pretty little trinkets, but had definite associations of dominion and victory, I don't see the need to labour the point.
The similarity between Revelation and this passage of Heichalot Rabbati doesn't point to any direct dependance, but to shared aspects of culture and historical circumstance.
David's crown differs from all the other crowns, and it contains emblems of the agents through which God ruled the universe.
"And God made the two great lights: the greater light to rule the day, and the lesser light to rule the night; and the stars. And God set them in the firmament of the heaven to give light upon the earth, and to rule over the day and over the night, and to divide the light from the darkness; and God saw that it was good (Gen 1:16-18)." At the end of Genesis Rabbah 6:9 we read about Joshua's greatness in commanding the sun and moon to be still "which are they who rule the world from one end to another."
Just like the sun, the glory of David's crown shines from one end of the world to another.
David is accompanied by the same heavenly beings that accompanied God's merkabah in Ezekiel 1. He is then seated upon an enormous throne of fire. Psalms and other scriptures applied to YHWH are recited, but YHWH is nowhere to be seen in all this.
That thrones belong to both earthly and heavenly kings is self-evident. As can be seen from the talmudic passage quoted above, both R. Akiba and R. Jose saw in the interpretation of Daniel 7:9 as a throne for David the implication that David was a divine figure, participating in God's rule and kingship. A secondary god, as I stated earlier. In Heichalot Rabbati, so do all the kings of Judah and Israel to a lesser degree, as well as the children of Israel.
One final aspect of David's coronation that I would like to consider is the material which the throne is made of- fire.
Daniel 7:9 says that throne which the divine figure is seated on is fire. Shiur Qomah, a mystical text closer in time to Heichalot Rabbati draws on the same imagery in Daniel, describing a fiery throne used by Metatron, God's viceroy. This is in addition to a description of God as a fiery being.
In parting, I would like to share a statement in Shiur Qomah regarding Metatron that sums up the attitude of the mystics towards man sharing in God's power.
"The name of the lad is the name of his master."