Quote
My database is called db, and in my database i made two tables: username, and password.
No, you didn't.
In your database called
db you created a
table called "Login" containing two
columns called `username` and `password`.
(For the moment, I'm going to
ignore the likelihood that you're holding passwords in plain text, which is a horribly, horribly Bad Idea).
Quote
So when I run this servlet I get a 404 error.
That's not a database error.
I suspect your servlet configuration or URL are incorrect, something like this:
http://p2p.wrox.com/servlets/85997-http-status-404-error-tomcat.html
Make sure that you can connect to your database using your chosen credentials using the mysql command line program.
And then
stop connecting your application to your database
as root - no application should
ever need to do so; it's another really horrible security vulnerability. Set up "application" accounts that make the database connection (and which also means that you
don't have to manage individual user permissions at the database level).
Regards, Phill W.