java.sql.sqlexception: access denied for user
You have to grant priviliges to root@localhost
e.g
GRANT ALL PRIVILIGES ON *.* TO 'root'@'localhost' IDENTIFIED BY password
(*.*: means everything, it can be modified to some specific DB or opertations)