When you say "it feels as if it is about to explode," if you mean it feels like you are about to have an orgasm, there is actually nothing wrong with doing so.
No idea really what you mean feels like it's going to explode -- do you mean you have to urinate, or orgasm? At any rate, you might consider seeing a urologist. If it's an urge to urinate, I get this problem, but I've had prostate surgery and it left my bladder in not great condition, so it's often irritated. So again, if you think there's something wrong with your bladder or your prostate, you need to see someone about it. On the other hand, if you're relatively young, it's common to wake up with an erection, though it usually happens when you're done sleeping and waking up naturally.