Rabbi Yosei said: There were three whose evil inclination attacked them and they took an oath against it; Joseph, David, and Boaz. Joseph, from where is it derived? As it is stated: “How can I perform this great wickedness [and sin against God]?” (Genesis 39:9). Rav Huna said in the name of Rabbi Idi: Is this verse lacking?

“And sin against the Lord,” is not written here, but rather, “against God.” He took an oath against his evil inclination and said: ‘By God, I will not sin and I will not perform this great wickedness.’ David, from where is it derived? As it is stated: “David said: As the Lord lives, rather, the Lord will strike him” (I Samuel 26:10).

To whom did he take an oath? Rabbi Yoḥanan and Rabbi Shimon ben Lakish, Rabbi Yoḥanan said: It was to his evil inclination that he took an oath. Reish Lakish said: It was to Avishai that he took an oath. He said to him: ‘As the Lord lives, if you touch him, I will mix your blood with his blood.’

That is what is written: “David said to Avishai: Do not destroy him” (I Samuel 26:9). Boaz, from where is it derived? As it is stated: “As the Lord lives, lie until the morning” (Ruth 3:13). Rabbi Yudan and Rabbi Ḥama, Rabbi Yudan says: All that night, his evil inclination was enticing him with words, and saying to him: ‘You are unmarried and she is unmarried.

You seek a wife and she seeks a husband.’ To the evil inclination he took an oath: “As the Lord lives.” To the woman he said: “Lie until the morning.” Rabbi Ḥanina said: “A wise man has might” (Proverbs 24:5), this is Boaz. “And a man of knowledge exerts strength” (Proverbs 24:5), as he overcame his evil inclination with an oath.