if you have had difficulty charging your battery, but once charged it holds it's charge then the problem is either the dock itself..in which case give it a very good clean out of all the dirt that may have gathered or replace it.
Once a battery has died beyond charging it will not charge from wall or pc no matter how much you try.
I'd suggest investing in a new battery and a new charging port (dock connector) then you know you have a clean starting point. As the phone is dead you don't have to worry about powering off before you start troubleshooting, but it's a good point to remember if you need to go back in and check connections once you have replaced those parts.