Bible Story - David and Goliath

Bible Story"David and Goliath" Then said David to the Philistine, You come to me with a sword, and with a spear, and with a shield: but I come to you in the name of the LORD of hosts, the God of the armies of Israel, whom you have defied. 

The Story of David - Knowing God’s Righteousness

After David sinned, God’s righteous punishment came upon him. Why did God not forgive him? What is the deeper meaning of God’s righteousness?