David always did what the Lord said was right and obeyed his commands all his life, except the one time when David sinned against Uriah the Hittite.