Naaah - close range battle is not like the above picture. Close range battle is going sniper vs. medic or sniper vs. soldier while you both are on your battlements.
When another class jumps right in front of you... what do you do?
Shoot and run.
Face it, a sniper sucks for close range battle. He is made to sit back at a distance and pick of enemies. However, you do have one good gun - the auto rifle - but it only gives you 75 bullets minus the bullets you already used from your sniper rifle.
If you do come in close contact with a heavier class (basically every class other than the scout), take out your auto rifle, and shoot while running backwards to a safe place. Also, be sure to prime a grenade at the enemy - who knows, you might just get a kill.