Home java строка не найдена

строка не найдена




I can not connect to database , which is stored on the hosting.

An error appears:

error: com.mysql.jdbc.exceptions.jdbc4.communicationSException: Communications Link Failure

And when connected to the database that is on my computer everything works:

The Last Packet Sent SuccessFully To The Server Was 0 Milliseconds Ago. The Driver Has Not Received Any Packets from The Server.
The assembly has been successfully completed (total time: 17 seconds)

package mysql;
Import java.sql. *;
Public Class Dbconnect {
  Private Connection CON;
  Private statement st;
  Private ResultSet RS;
  Public dbconnect () {
    Try {
      Class.Forname ("com.mysql.jdbc.driver");
      CON = DRIVERMANAGER.GETCONNECTION ("JDBC: mysql: //mysql.hostinger.ru: 3306 / u740438416_test", "u740438416_asd", "asdasd");
    } Catch (Exception EX) {
      System.out.PrintLN ("Error:" + EX);

Answer 1, Authority 100%

Causes of the Communications Link Failure error can be a lot. The bottom line is that JDBC cannot connect to this database. Check the database data: URL, port, server server with database, database settings, Firewall your / on the server and other

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions