我有这个代码;

String sql = "UPDATE Players SET Losses=Losses+1 WHERE UUID='" + p.getUniqueId() + "';";
stmt.executeUpdate(sql);


如何获得特定Losses的当前Player p

最佳答案

您可以得到如下损失。似乎真的很琐碎,猜你是绝对的初学者。

String sql = "SELECT Losses FROM Players WHERE UUID='" + p.getUniqueId() + "';";
ResultSet rs = stmt.executeQuery(sql);
int losses = -1;
if(rs.next()) {
    losses = rs.getInt("Losses");
}

10-08 18:47