The full error message may be :
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password : YES)
or
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: NO)
When we try to connect to a database through JDBC with wrong username or password - we see this error message.
See the sample code below:
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/DatabaseName","root","mypassword");
In...
Read More