在WebFx App

时间:2016-09-16 07:01:17

标签: java mysql database jdbc server

我的电脑的xampp不工作,我有一个网络服务器。我无法使用以下代码连接到MySql数据库

        Class.forName("com.mysql.jdbc.Driver");
        connection=DriverManager.getConnection("jdbc:mysql://server188.web-hosting.com:2083/databaseName","user","password");
        System.out.println(connection);
        System.out.println("Connected!");

它出现以下错误:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server

这不是关于连接localhost。这是一个WebHosting。请帮我。找不到我的错误。

0 个答案:

没有答案