bladder infection?

So I've had two bladder infections so far this summer, and I think I might have another one. I continuously feel like I have to pee and it burns as well, but it comes and goes throughout the day. I sometimes masturbate using the shower head, and I was thinking that maybe it's because of that ? Also, maybe because I hold it in almost all day long. Someone help please?