Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
解决方法:把url后边的安全连接参数删除(有警告)或改成false【SQL版本大于connect版本,就要设置成false】:
String url=“jdbc:mysql://localhost:3306/xx? useUnicode=true&characterEncoding=utf8&useSSL=false”;