Bungeecord, long form sql

Discussion in 'Spigot Help' started by IvenCraft, Aug 13, 2018.

Thread Status:
Not open for further replies.
  1. US:
    Hello i have a little problem and i wanted to write a mysql ban system. But when I wrote the getLong method, I probably made some mistakes and can not find them now, because the same method for Spigot is also not available for Bungeecord. I saved the long as BigInt in sql.

    Hir my method:

    Code (Java):
    public static long getlong(String uuid, String NameinSQL) {
            long i = 0;

            if (playerExists(uuid)) {

                try {
                    ResultSet rs = mysql.query("SELECT * FROM " + Name + " WHERE UUID= '" + uuid + "'");
                    if ((!rs.next()) || (Long.valueOf(rs.getLong(NameinSQL)) == null))
                        ;

                    i = rs.getLong(NameinSQL);

                } catch (SQLException e) {
                    e.printStackTrace();
                }

            } else {
                return 0;
            }

            return i;
        }
    If it helps me, that would be cool xD

    DE:
    Hallo ich habe eine kleines Problem und zwar wollte ich eine mysql Ban system schreiben. Aber als ich die getLong Methode geschrieben habe habe ich wohl eineiige Fehler gemacht und kann sie jetzt nicht finde, da bei geht die gleich Methode bei Spigot auch aber leider nicht bei Bungeecord. Ich habe die Long als BigInt in sql gespeichert.

    Hir meine Methode:

    Code (Java):
    public static long getlong(String uuid, String NameinSQL) {
            long i = 0;

            if (playerExists(uuid)) {

                try {
                    ResultSet rs = mysql.query("SELECT * FROM " + Name + " WHERE UUID= '" + uuid + "'");
                    if ((!rs.next()) || (Long.valueOf(rs.getLong(NameinSQL)) == null))
                        ;

                    i = rs.getLong(NameinSQL);

                } catch (SQLException e) {
                    e.printStackTrace();
                }

            } else {
                return 0;
            }

            return i;
        }
    Wenn mir einer Helfe kann wäre das cool xD
     
Thread Status:
Not open for further replies.