I suspect this may be a false positive, but I can't be sure, so I'm somewhat confused. I'm using Eclipse Neon and the issue is appearing at the third time I prepare a statement. I do something almost identical down below, with no errors.
try{
Connection con = MySQL.connection;
PreparedStatement ps = con.prepareStatement("SELECT * from UsernameData "
+ "WHERE UUID = '" + player.getUniqueId() + "'");
ResultSet rs = ps.executeQuery();
if(rs.next() == true){
ps = con.prepareStatement("update UsernameData set UUID = ?, Username = ? where UUID = ?");
ps.setString(1, uuid);
ps.setString(2, username);
ps.setString(3, uuid);
ps.execute();
ps.close();
rs.close();
return;
}
ps = con.prepareStatement("insert into UsernameData(UUID, Username)"
+ " values (?, ?)");
ps.setString(1, uuid);
ps.setString(2, username);
ps.execute();
ps.close();
rs.close();
return;
}catch(SQLException e){
Bukkit.getServer().getLogger().warning("SQL Error: " + e);
}