MySQL Error

Discussion in 'Plugin Development' started by creppii, Nov 10, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    creppii

    Hey,

    what's wrong with my mysql connection?
    i get this error: Communications link failure

    and thats my connection:
    Code:java
    1. Connection con = DriverManager.getConnection("jdbc:mysql://" + this.host + ":" + this.port + "/" + this.database, this.user, this.password);


    now it works ^^
    what was wrong:
    Code:java
    1.  
    2. //wrong
    3. public int port;
    4. cfg.addDefault(db + "port", "3306");
    5.  
    6. //correct
    7. public int port;
    8. cfg.addDefault(db + "port", 3306);
    9.  


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
  2. Offline

    rete25iscool

    Mark it as solved then?
     
Thread Status:
Not open for further replies.

Share This Page