SQL Connection doesn't work on a live server

Discussion in 'Spigot Plugin Development' started by JordanOsterberg, May 24, 2015.

  1. I was testing a plugin on a localhost server, then I went to test it on the live server and it couldn't connect to the SQL server. It set my info as a blank: ""

    Code:
    PHP:
     public String getHubRank(Player p){
            try {

                PreparedStatement st = connection.prepareStatement("SELECT `hubrank` FROM `netdata` WHERE `uuid` = ?");
                st.setString(1, p.getUniqueId().toString());

                ResultSet rs = st.executeQuery();

                String value = "";

                if (rs.next()){

                    value = rs.getString("hubrank");

                    rs.close();
                    st.close();

                }

                return value;

            } catch (Exception e){
                e.printStackTrace();
                return "ERROR";
            }
        }
    Thank you!
     
    #1 JordanOsterberg, May 24, 2015
    Last edited: May 24, 2015
  2. I found the issue, the server isn't running in bungeemode I believe.
     
  3. Change that char with this char --> '