I have been trying to set up a DatabaseConnectionPool for a web app for the last couple of days with no success. I have read the relevant sections of the Tomcat docs and a g
Your setup looks fine. This looks to purly be a permissions problem.
You need to grant that user access in mysql. While Java will connect to localhost, it will do so using tcp/ip - however in mysql localhost and 127.0.0.1 have different meaning. Issuing this SQL should do the trick.
grant all on twitter.* to 'root'@'127.0.0.1' identified by 'mypwd';
That assumes Java resolves 'localhost' to 127.0.0.1, if things still doesn't work, you could try changing your connection string to "jdbc:mysql://127.0.0.1:3306/twitter"
Should I have this in my context.xml or just the normal password?
As you have it now, the plaintext password.
In your configuration context.xml for the webapp you have to change user="root" by username="root"