David (; ISO 259-3 Dawid; '; Strong's : Daveed) according to the Hebrew Bible , was the second king of the United Kingdom of Israel , and according to the New Testament Gospels of Matthew and Luke , an ancestor of Jesus .