Yes, there is a connection between masturbation and prostate cancer. Masturbating reduces the changes of prostate cancer.
from:
Can Masturbation Help Prevent Prostate Cancer?
"The information on frequency of ejaculation comes from study questionnaires issued to over 30,000 health professionals who participate in the decades-long Health Professionals Follow-up Study. The questionnaire does not ask how ejaculation was achieved, so presumably any act leading to orgasm with ejaculation is included, not just intercourse. Dividing the data into age categories shows that as men age, they tend toward fewer ejaculations per month. The authors found that the risk of developing PCa was lowered by 20% for men who ejaculated 21 times per month, as compared to those who ejaculated 4-7 times per month. Interestingly, “A similar Australian study found the risk was reduced by 36 percent when men ejaculated seven times a week."