MySQL connection problem



Hi everybody

I am just tired about this error, i don't know how to fix it....

I get the error:
java.sql.SQLException: null, message from server: "#HY000Host 'localhost.localdomain' is not allowed to connect to this MySQL server"


Part of the code is:

String url = "jdbc:mysql://localhost:3306/project";
db = DriverManager.getConnection(url, user, pass);

whenever i do:
mysql -h localhost -u anyone -p any

it works without any problem, but here... IT JUST DONT WORK !

thanks for your very precious help

Marcelo
.