Then shall you prosper, if you observe to do the statutes and the ordinances which Yahweh gave Moses concerning Israel. Be strong, and of good courage. Don't be afraid, neither be dismayed.
Now David had his admirable points, but David also had his weak points. And David, for the most part, was a poor father. And as the result of the fact that he was a poor father, he had problems with his children. Now Solomon, in observing this and later writing the Proverbs, had many things to say about correcting children. That's one thing that David was very lax in, that was the correction of his sons.