King David was arguably the greatest king of Israel. Born a shepherd for his father, Jessie, his life changed when Samuel came to Jessie's house and under God's guidance anointed David king of Israel, after King Saul was seen wicked in God's eyes.
When Saul was later cursed with a spirit of insanity, he hired David as a musician to calm his nerves; however, after learning that David was to succeed him and growing jealous that the people of Israel began to praise David's military victories, Saul tried to kill David several times, leading to David running away into self-imposed exile with the aid of Saul's son Jonathon, David's best friend. Saul immediately gave chase, obsessively searching for David to kill him.
A one point, David and his men were hiding in a cave that Saul was searching, and though David's men encouraged him to kill Saul, he refused and told Saul this later, when he showed Saul the piece of his robe that David had been close enough to cut off as proof. Saul realized he had sinned, and swallowed his pride to accept David's anointing as king. Saul tried to kill himself later after losing in battle to the Philistines—when his armor-bearer would not stab him, Saul attempted to kill himself on his own sword, but was unsuccessful and had an Amalekite finish him off. Jonathon and Saul's other two sons were also killed. When he heard of Saul's and his sons' deaths, David ordered the Amalekite who finished Saul killed.
David was a great king, both in power and in goodness and wisdom, but his sin nature overtook him with a woman named Bathsheba, with whom he committed adultery and whose husband Uriah he had placed on the front lines so that Uriah would be killed and David could marry Bathsheba. However, a prophet named Nathan approached David and rebuked him for his sins and declared that God's punishment would be that David's house would never know peace. This prophecy came true—not only did David's child die, but his son Absalom murdered his brother for hurting their sister, and Absalom fled. Absalom then returned and conspired against his father to overthrow him, and David fled Jerusalem. Absalom died later, and after David mourned for him, he continued his reign over Israel, defeating many more of its enemies.
When David was very advanced in age, he was unable to do his duties as king to Israel, and his son Adonijah set himself up as king. However, Nathan and Bathsheba reminded David that God intended for Solomon to become king, and Solomon was anointed king with minimal resistance from a terrified Adonijah. Before he died, David instructed Solomon to be strong in his walk with God and to keep God's commands; David then died after many years of reigning over God's kingdom.
His father was Jessie, his grandfather was Obed, and his great-grandfather was Boaz, husband of Ruth. He had many wives, including Bathsheba and King Saul's daughter Michal. He had multiple sons, one of whom, Solomon, became king after him. The biological line of David can be traced down to Jesus.