The thing you call a query is in fact a sequence of queries, separated by semicolons.
But you can't run more than one query at a time through JDBC.
You need something like this:
PreparedStatement ps1 = connection.prepareStatement
("SET @r=0");
ps1.ExecuteQuery();
PreparedStatement ps2 = connection.prepareStatement
("UPDATE `hg_stats` SET `stats_rank`= @r:= (@r+1) ORDER BY `stats_score` DESC");
ps2.ExecuteQuery();