Had you refused demands? This will, of course, make the AI angry; and if the AI making the demand is powerful enough, and the demand small enough (a small amount of gold, say) you may want to cave in to maintain relations if you don't want a war.
Also, if you're in a potentially hazardous situation like this when an AI declares war, see if you can beat them to the punch by signing alliances with other AIs. This simultaneously lightens the potential load on your military and gives the attacking AI civ something else to worry about.
And finally, perhaps you aren't building enough military? It's a good idea to have some "camp" towns that just build a barracks and then do exclusively military units.
And one more thing I will mention generally, especially as you say you are new to civ3: One sub-optimal strategy a lot of new players use is to use "OCP" placement - keeping 3 to 4 tiles in between each city, in order to keep most of the 20 tiles in the radius exclusive to one city. While this allows your cities to grow in to quite large metros (metros=size 13 and up), remember that you won't be getting hospitals (required for metro size) until the Industrial Era, some time in to the game; until then, 8 of those 20 exclusive tiles will go unused. Also, if you use wide spacing early in the game, your cities will suffer from Despotism's horrendous distance corruption. In short: try spacing your cities closer, with only 2 to 3 tiles in between.
Oh, and build more workers. As many of the tiles being worked by your citizens as possible should be improved; ideally, your workers should only be concerned about improving tiles that will be worked in future as your cities grow.
Anyway, welcome to Civ3.