King David's Spaceship is set in Jerry Pournelle's CoDominium science fiction universe.
Prince Samuel's World was isolated and regressed technologically to about 19th century levels by the collapse of the human First Empire following the Secession Wars. Colonel Nathan MacKinnie, in defense of the Republic of Orleans, has repeatedly defeated the forces of the much larger kingdom of Haven, that is until the planet is rediscovered by the Second Empire. The Second Empire wishes to incorporate the planet, but first the various small states must be consolidated into one. They back Haven for the task, using their advanced weapons to wipe out MacKinnie's force - and his fiancee - and forcing Orleans to surrender.
Later, MacKinnie is offered a job by Malcolm Dougal, head of the Haven secret police. Dougal has discovered that the Imperials intend to bring in colonists to rule the planet once it is united. However, if Prince Samuel's World can build a spaceship before then, they can petition to join the empire with a higher, self-governing status. The unsuspecting Imperials are willing to transport a trade mission to Makassar, an even more primitive planet, unaware that there is a First Empire electronic library there. Dougal wants MacKinnie to secretly bring back the knowledge in the library so that Haven can try to build a spaceship.
MacKinnie, his trusted men, some picked Haven scholars and an unusually well-educated young woman named Mary travel to Makassar. They are landed at a port blockaded by pirates. One of the Havenites converts a local sea vessel into a much more advanced type of ship, and they are able to break through the blockade and reach the city where the library resides. However, that Christian city is under siege, by Muslim tribesmen, and close to falling. In order to persuade the city leaders to give his people access to what the locals consider a holy relic, MacKinnie trains the men he is grudgingly given in new infantry tactics, and leads them in defeating the cavalry-based besiegers. His people copy as much of the information in the library as they can and return home.
They manage to build and launch a very primitive manned ship (with Mary aboard) into orbit around the planet. The Imperials are humiliated, but there is little they can do about it except to find some scapegoats. MacKinnie and Mary, who have fallen in love, are exiled to Makassar (where they want to be anyway).
Best part of story, including ending:
It's got a good plot and plenty of battles.
Best scene in story:
In the first skirmish and the following climactic battle, the military tactics are laid out in detail.
Opinion about the main character:
MacKinnie is a stereotypical military genius who can do no wrong, like another Pournelle character, John Christian Falkenberg, and too many others in the military science fiction genre.