"And David said to Gad: I am in great distress, etc." (II Samuel 24:14). R. Shimon ben Yochai taught: To what was David comparable at that hour? To a sick man who has declined toward death. They said to him, "Where do you wish that we lay you down — beside your father or beside your mother?" [He says to them,] "Woe to the ears that hear such a thing!" So too, "And David said to Gad: I am in great distress."
David's Dread Choice After the Census in Midrash Shmuel
Midrash Shmuel 31:2
ויאמר דוד אל גד צר לי מאוד וגו' (שמואל ב' כ"ד י"ד), תני ר' שמעון בן יוחי למה היה דוד דומה באותה שעה, לחולה שנטה למיתה, אמר ליה אן את בעי ניתנינך גבי אביך או גבי אמך, [אומר להן], ווי להון לאודניה דהכדין שמעין, כך ויאמר דוד אל גד צר לי מאד.