Load highest score on startup

This commit is contained in:
2015-07-06 16:59:40 +02:00
parent be274685b5
commit 54d9a91f6a
+12
View File
@@ -169,6 +169,18 @@ public class SQLConnector
} catch (SQLException e) {
e.printStackTrace();
}
Statement st4 = executeResultQuery("SELECT MAX(`score`) as score FROM `highscore` WHERE `songinstance`=(SELECT id FROM songinstance WHERE song=" + id + " AND difficulty='" + si.getDifficulty() + "')");
try {
ResultSet rs4 = st4.getResultSet();
if(rs4.next())
{
int i = rs4.getInt(1);
si.setHighestScore(i);
}
} catch (SQLException e) {
e.printStackTrace();
}
}
}
else