Passage
And he said: While the child was yet alive, I fasted and wept for him: for I said: Who knoweth whether the Lord may not give him to me, and the child may live?
And he said: While the child was yet alive, I fasted and wept for him: for I said: Who knoweth whether the Lord may not give him to me, and the child may live?
2 Samuel 12:20 Then David arose from the ground, and washed and anointed himself: and when he had changed his apparel, he went into the house of the Lord: and worshipped, and then he came into his own house, and he called for bread, and ate.
2 Samuel 12:21 And his servants said to him: What thing is this that thou hast done? thou didst fast and weep for the child, while it was alive, but when the child was dead, thou didst rise up, and eat bread.
2 Samuel 12:22 And he said: While the child was yet alive, I fasted and wept for him: for I said: Who knoweth whether the Lord may not give him to me, and the child may live?
2 Samuel 12:23 But now that he is dead, why should I fast? Shall I be able to bring him back any more? I shall go to him rather: but he shall not return to me.
2 Samuel 12:24 And David comforted Bethsabee his wife, and went in unto her, and slept with her: and she bore a son, and he called his name Solomon, and the Lord loved him.
The verse centers on "said", "child", "alive", "fasted", "wept", "knoweth", and "whether". It is saying that the verse draws attention to "said" and "child", so its meaning should be read from those terms before moving to application.
The nearby context moves from verse 21's "And his servants said to him What..." into verse 23's "But now that he is dead why...", so "said" and "child" belong inside that flow. In 2 Samuel context, the local focus is covenant, worship, and faithfulness.
A plain takeaway is to answer the verse's own emphasis on "said" and "child" with trust shaped by these words, not by a vague optimism outside the passage.