Some people will insist you have to ride in the road at all times, but in downtown San Jose, it's safer imo to mix sidewalk and road riding, depending on the street, time of day and level of traffic. ideally you should find a route which allows you to stay on the road as much as possible, simply because roads are smoother and you can go faster
When riding on the sidewalk, you have to think and act more like a fast moving pedestrian than a bike rider.. ie stop/slow down at intersections to ensure no cars are turning, watch out for cars coming down driveways, etc
When riding in the road, don't be afraid to "take the lane" and act like a car when you have to. If you ride predictably and with the speed of traffic, most car drivers will give you your space.