Sounds like a bad connection somewhere. Quite possibly the output jack. But, you should attempt to isolate the problem by verifying that the issue is not in your amp or instrument cable first. Use the process of elimination to narrow the possibilities.
Did you try another instrument to make sure it was the bass that was faulty ? If the cable and amp work in that case, then it is likely some wiring issue inside the bass. Jack wires tend to go sooner due to the plugging/unplugging/twisting etc.