The phone can used both static IP and automatic. You can place it on static for example at work or home where you have a fixed IP, and then change it to automatic when you connect to public. You won't lose the settings for the fixed IP. Its still remembered.
That said, I can't tell you why it won't connect since there could be so many potential issued, and not just due to the phone. It could be the wifi being protected, to having fixed IP or the phone must be set on automatic IP.