David followed Yah except for the case of Bathsheba. Acknowledge the sin, be remorseful and repent and move on. The rabbis giving excuse for adultery saying it was not sin are probably covering for themselves in case they got caught. Had Bathsheba been single there would not be sin. It goes to my point that sex is not sin. It is the "with whom" that establishes the sin. Same with the "Thou shalt not covet" aspect. IF that woman belongs to someone else(husband) then she is off limits.
Son, direct your gaze someplace else!
Coveting or desiring is a natural action and is acceptable as long as that object or person is actually available for transaction. You have to covet(desire) before you buy anything. Coveting that is out of control leads to theft, lying, adultery, murder, etc. Oh Wait! THAT is what David did! Coveting the wrong things is the foundation for many other sin. If one cannot LEGALLY obtain said object, THEN it is sin. If it is for sale, then take a look!
I have refused many times to have extended contact with a woman that belongs to someone else. I don't need that problem. But on the other hand you need to determine if that human soul would be beneficial in your life.