King David saw the beautiful Bathsheba bathing; he sent her husband to the wars to get him killed, and then married her. As one of his less commendable exploits this earned him a divine rebuke (2 Samuel 11: 2). David is seen on the roof of the building at the upper right.
The picture is too weak to be by Giordano. It was possibly painted after Giordano's death and perhaps in Rome rather than Naples.