There is an active ingredient in cranberries that prevents bacteria from sticking to the bladder wall; however, cranberry juice or capsules may not contain enough of this active ingredient to be beneficial in preventing symptoms. Research is conflicting. Nevertheless, cranberry juice is a common method used by people to prevent urinary tract infections.