King David's Spaceship is a novel by science fiction author Jerry Pournelle. It was originally published in 1980. Another version appeared as 3-part serial in Analog as "A Spaceship for the King" December 1971 through February 1972.
In content it resembles Pournelle's military fiction series Falkenberg's Legion, also from the CoDominium series, in that it is the story of a capable military leader undertaking a campaign on a backward planet. In this case the leader is from a planet that has recovered technologically to the steam, steel and coal stage, who visits a planet of city states surrounded by barbarians, fighting with medieval weapons.
The story is notable for showing the conflicting motives of the different factions without demonizing any of them, save possibly the merchants' faction whose motives are to use the forces of the Imperial Space Navy to enhance their own profits.
The action opens on a planet called Prince Samual's World. Bombed heavily during the Secession Wars, it has spent 400 years in isolation. Much of the technological knowledge of the First Empire was lost; when ships of the Second Empire find the system, the planet's technological level is somewhere around that of 19th century Europe.