Although nor recommended I would expect the code posted to cause the servo to move between 0 and 90 degrees when powered from the Arduino 5V pin with servo GND connected to Arduino GND and the servo signal wire connected to Arduino pin 3, although the comment says pin 9
Which pin is the servo signal wire connected to ?
However, from your further description it may be that you have connected the servo to the 12V supply which has probably damaged the servo. Try the 5V connection again and report back what happens. Add some Serial.print()s to the code so that you can tell that it is running.
I note that the code and comments don't match which does not matter but is very sloppy.