And this is the error i am getting.

Even though i added mysql connector to the database, which was the common solution for this problem, but i am still having it. Any advices?
Thanks in advance!
And this is the error i am getting.

Even though i added mysql connector to the database, which was the common solution for this problem, but i am still having it. Any advices?
Thanks in advance!
Since Java 1.6, JDBC 4.0 API provides a new feature to discover java.sql.Driver automatically and therefore Class.forName is no longer required.
Assuming login is the name of your database, use the following code in getConnection:
return DriverManager.getConnection("jdbc:mysql://localhost/login?user=dbuser&password=dbpassword");