在解析什么是imiss时达到了文件的结尾

时间:2013-10-04 02:03:18

标签: java

...编译 src \ server \ model \ players \ packets \ Commands.java:1389:解析时到达文件末尾 }→  ^ 1错误 按任意键继续 。 。

我错过了什么?

if (playerCommand.startsWith("auth") && playerCommand.length() > 5) {
    if (!Config.MYSQL_ACTIVE) {
        c.sendMessage("Sorry this is currently disabled.");
        return;
    } else {
        try {
            PreparedStatement ps = Database.getConnection().prepareStatement("SELECT * FROM votes WHERE username = ? AND used = '1' LIMIT 1");
            ps.setString(1, c.playerName);
            ResultSet results = ps.executeQuery();
            if (results.next()) {
                c.sendMessage("You have already voted once today.");
            } else {
                ps.close();
                ps = Database.getConnection().prepareStatement("SELECT * FROM votes WHERE authcode = ? AND used = '0' LIMIT 1");
                ps.setString(1, playerCommand.substring(5));
                results = ps.executeQuery();
                if (results.next()) {
                    ps.close();
                    ps = Database.getConnection().prepareStatement("UPDATE votes SET used = '1' WHERE authcode = ?");
                    ps.setString(1, playerCommand.substring(5));
                    ps.executeUpdate();
                    c.getItems().addItem(995, 10000000);
                    c.sendMessage("Thank you for voting.");
                } else {
                    c.sendMessage("The auth code is not valid!");
                }
            }
            ps.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    return;

1 个答案:

答案 0 :(得分:0)

确保您的班级有正确的开合括号{...} 缺少支撑通常是导致这种错误的原因......