I've got a Java application and I must connect with a MySQL DB host in aruba.it. Basically create a connection, aruba.it refuses that. How you can solve this?

To begin, I suppose that you are attempting to run this Java application in your area, or at best in a different machine than in which the MySQL DB runs which you have a SQLException: Connection Declined.

To repair the specific problem, all hubs and fire walls within the complete network pipe between your client (in which the Java application runs) and also the server (in which the MySQL DB runs) must be set up to permitOrahead the port number that the DB uses. This really is automatically 3306. If the port is blocked, you can't achieve the DB from outdoors.

Another option would be simply to upload the Java application in flavor of the webapplication and run it by HTTP. You'd normally use JSP/Servlet with this.

Aside from network, hubs, firewall issues the main reason could be that automatically remote use of MySQL database server is disabled for security reasons. Mostly DB is located on a single server or about the reliable server. Should you run java application out of your desktop, you have to configure MySQL therefore it need this connections. See this manual for particulars how to get it done.