public void run () {
        while (true) {
            if (conn != null) {
                try {
                    Statement statement = conn.createStatement();
                    statement.executeUpdate("/* ping */ SELECT 1");
                    statement.close();
                } catch (SQLException e) {
                    System.err.println("MySQL Fatal Error: " + e.toString());
                    Main.globalVars.sendServerMessage("The server is going down for halt NOW!");
                    try {
                        Main.serverSocket.close();
                    } catch (IOException e1) {
                        e1.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
                    }
                    System.exit(-1);
                }
                try {
                    Thread.sleep(10000);
                } catch (InterruptedException e) {
                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
                }
            }
        }
    }