1 Kings 9:4
"And you, if you walk before me as your father David walked, with integrity of heart and with uprightness by doing everything I have commanded you, and you obey my regulations and my judgements.."
Although David made a lot of big mistakes it was said in 1 Kings 9:4 that he had walked with integrity of heart. Overall he did live faithfully and when he made a mistake he corrected it. Our integrity also really matters to Jehovah, and although we are imperfect we can remain in his favor. We can strengthen our integrity by deepening our faith and trust in Jehovah, and by correcting our mistakes.
Read the Bible online for free at JW.org