How can a person be abstinent? How can a person be abstinent and overcome all sexual urges including self-gratification in accordance with the Buddhist tradition ? What prescription do the teachers give to get over such obstacles ?
Any such urge gives rise to feelings. What you should do is look at the feeling equanimously and objectively so that cravings for sensual pleasures do not arise. This is in Dependent Origination.

Initially the success would be very limited with only a few seconds of success, but as you go on the duration would increase and at one point you would be able to continuously be equanimous. To be able to do this you have to do Vipassana Meditation.

For a lay person the general recommendation is to abstain from sexual misconduct. You do not have to go to this extent, but this would become natural when you become Anāgāmi which is one Stage of Enlightenment.