From Abraham to King David, his ancestors were:
Abraham, Isaac, Jacob, Judah and his brothers (Judah's sons were Perez and Zerah, and their mother was Tamar), Hezron;
Ram, Amminadab, Nahshon, Salmon, Boaz (his mother was Rahab), Obed (his mother was Ruth), Jesse, and King David.
David, Solomon (his mother had been Uriah's wife), Rehoboam, Abijah, Asa, Jehoshaphat, Jehoram;
Uzziah, Jotham, Ahaz, Hezekiah, Manasseh, Amon, Josiah, and Jehoiachin and his brothers.