The Court History of David (more frequently simply the Court History) is one of the two hypothetical main source documents of the Books of Samuel (the other being the Accession History). The text is believed to cover most of 2 Samuel except for the first few chapters and a few more minor parts. The Court History includes several stories with a distinctly negative attitude toward David (e.g., the story of his adultery with Bathsheba).
Richard Elliott Friedman has recently suggested in his book The Hidden Book in the Bible that the Court History and the Accession History were originally part of a single historical epic by the Yahwist author covering the history of the Israelite world until the time of David and Solomon.
Friedman's thesis in The Hidden Book in the Bible is that the Yahwist author wrote many of the most familiar stories in the Hebrew Bible (including the stories of Adam and Eve, Abraham, Moses, and David) as one unified text. The Hidden Book analyses the punctuation patterns, word choice, sentence structure and allusions used in the biblical stories; and reconstructs what Friedman says is the original, foundational text at the heart of the Bible.