I Chronicles 29:26–30

So David the son of Isai reigned over all Israel. 27And the days that he reigned over Israel, were forty years: in Hebron he reigned seven years, and in Jerusalem three and thirty years. 28And he died in a good age, full of days, and riches, and glory. And Solomon his son reigned in his stead. 29Now the acts of king David first and last are written in the book of Samuel the seer, and in the book of Nathan the prophet, and in the book of Gad the seer: 30And of all his reign, and his valour, and of the times that passed under him, either in Israel, or in all the kingdoms of the countries.