But as I pondered this and other similarities, what caught my eye- especially when I try applying the stories to myself- was two differences, one major and one you might almost miss.
I'm betting you can guess the major one- sexual temptation. Joseph had open access to Potiphar's wife, and he turned it down, despite the consequences and what he was missing out on. In fact, he RAN, even leaving his robe behind. David had open access to Uriah's wife- and took it.
Now if you read the Psalms, you can't help but think that David and Joseph were equally close to God. They had the same access to God, and David had even greater experience, perhaps, in knowing what God could do for him- where Joseph had to that point survived the pit and being sold by Ishmaelites, David had survived Goliath AND Saul, as well as a rebellion by his son Ammon. So why did David fall where Joseph did not?
Now I can't be sure this is the reason, but this minor difference I caught came to mind. First, let's look back at the story which led to Joseph being a victim of the jealousy of his brothers:
Gen 37:11 And his brothers were jealous of him. But his father observed the word.
Gen 37:12 And his brothers went to feed the flock of their father in Shechem.
Gen 37:13 And Israel said to Joseph, Are not your brothers feeding the flock in Shechem? Come, and I will send you to them. And he said to him, Behold me.
Gen 37:14 And he said to him, Now go, see the welfare of your brothers, and the welfare of the flock, and bring word back to me. And he sent him out of the valley of Hebron. And he came to Shechem.
Gen 37:15 And a man found him. And, behold, he was wandering in the field. And the man asked him, saying, What do you seek?
Gen 37:16 And he said, I am looking for my brothers. Please tell me where they are feeding the flock.
Gen 37:17 And the man said, They have left here, for I heard them say, Let us go towards Dothan. And Joseph went after his brothers and found them in Dothan.
Gen 37:18 And they saw him from a distance. And before he came near to them, they plotted against him, to kill him.
And now, David's run in with his own brothers:
1Sa 17:17 And Jesse said to his son David, Please take to your brothers an ephah of this roasted grain and these ten loaves, and run to the camp, to your brothers.
1Sa 17:18 And you shall take these ten cuttings of cheese to the commander of the thousand, and you shall visit your brothers, as to how they fare. And you shall bring their token.
1Sa 17:19 And Saul, and they, and all the men of Israel were in the valley of Elah, fighting with the Philistines.
1Sa 17:20 And David rose up early in the morning and left the sheep with a keeper, and got up and went, as Jesse commanded him. And he came to the barricade, and to the army which was going out to the battle array. And they were shouting for battle.
1Sa 17:21 And Israel and the Philistines set up in battle array for rank to meet rank.
1Sa 17:22 And David left the goods on him into the hands of the keeper of the goods, and he ran to the army. And he he came and asked his brothers of their welfare.
1Sa 17:23 And as he was speaking to them, even, behold! The man between the two, Goliath the Philistine was his name, came up out of the ranks of the Philistines. And he spoke according to these words. And David heard.
1Sa 17:24 And when they saw the man, all the men of Israel ran from him, and were very much afraid.
1Sa 17:25 And the men of Israel said, Have you seen this man who comes up? For he has come to reproach Israel. And it shall be, the man who strikes him, the king will enrich him with great riches, and he will give his daughter to him. And he will make his father's house free in Israel.
1Sa 17:26 And David spoke to the men who were standing with him, saying, What shall be done to the man who strikes this Philistine, and turns aside reproach from Israel? For who is this uncircumcised Philistine that he should reproach the armies of the living God?
1Sa 17:27 And the people spoke to him according to this word, saying, So shall it be done to the man who strikes him.
1Sa 17:28 And his eldest brother Eliab heard when he spoke to the men. And Eliab's anger glowed against David. And he said, Why is it you have come down? And with whom have you left those few sheep in the wilderness? I know your pride and the evil of your heart, for you have come down to see the battle.
1Sa 17:29 And David said, What have I done now? Was it not but a word?
"OK, Chris, so what's the catch here?" Well, and it's a little one indeed. David arrived on his own; Joseph allowed himself to be led by a mysterious man who found him.
Confused? Joseph was of a character that allowed him to be led. Anointed a leader by God, but willing to be led by God. David, similarly anointed, was of a character that made him a leader first, not seeking help in determining the right and wrong way. So when Joseph hit his "stumbling block", he followed the leading of the Lord and ran away. David met his stumbling block, plunged straight ahead and fell on his face.
So the moral of this connection is this- if you allow yourself to be led by God, He will keep you in His will, and while it might not start out great in the eyes of men, God will prosper you in the end. Having all the faith in the world isn't going to save you without this part, as David learned.