connecting RTC DS1307 to ethernet shield
I assume that snippet of code is supposed to provide the +5Vand GND for powering the RTC module.  Well, there's two fundamental flaws with it:


Pins 2 and 3 are the DIGITAL pins, not the analog pins. Instead you want to be using pins A2 and A3.
analogWrite controls the PWM output on pins that support PWM. HIGH is 1, so analogWrite will be providing a 1/255 duty cycle PWM signal on that pin.


So to fix it:


Use pins A2 and A3 instead of 2 and 3
Use digitalWrite() instead of analogWrite().