Book of Proverbs
The passage seems to be the one direct address to a king in the Book of Proverbs – something that was the norm in wisdom literature of the ancient world.