Read 2 Samuel 12:16 Using Other Translations
David therefore besought God for the child; and David fasted, and went in, and lay all night upon the earth.
David therefore sought God on behalf of the child. And David fasted and went in and lay all night on the ground.
David begged God to spare the child. He went without food and lay all night on the bare ground.