Ali ibn Muhammad ibn Al-Jahm said...
Ali ibn Muhammad ibn Al-Jahm said, “They say that David (s) was in his praying niche when Satan appeared in front of him in the form of a very beautiful bird. David (s) stopped praying and stood up to go catch the bird. The bird left the room and went into the courtyard. Then it flew up to the top of the house. David climbed up to the roof looking for it. Then the bird flew into the house of Uryah ibn Hannan.
David followed the bird with his eyes, and suddenly saw Uryah's wife who was making major ritual ablutions. Once he looked at her, he fell in love with her. As for Uryah, he had been sent to a battle. David wrote to his commander, “Place Uryah in front of the coffin.” Thus he was placed in front of it. Uryah defeated the pagans. That was hard on David, so he wrote to his commander again and ordered him to place Uryah ahead of the coffin. Then Uryah was placed ahead of it and was killed.
Then David married his wife.” The narrator added, “Al-Reza (s) hit himself on the forehead and said, ‘From God we are, and unto Him is our return! You have ascribed neglecting prayers and going out and looking for the bird’s tracks, fornication and killing to one of the Prophet’s of God.’” Ali ibn Al-Jahm said, “O son of the Prophet of God! Then what was his sin?” The Imam(s) said, “Woe be to you! David thought that the Honorable the Exalted God had not created anyone more learned than himself.
وَجَلَّ لا يُضَيِّقُ عَلَيْهِ رِزْقَهُ أَلا تَسْمَعُ قَوْلَ اللَّهِ عَزَّ وَجَلّ