We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 43ac0e0 commit a13f7eaCopy full SHA for a13f7ea
src/main/java/net/javadiscord/javabot/systems/qotw/dao/QuestionPointsRepository.java
@@ -96,7 +96,7 @@ public List<QOTWAccount> sortByPoints() throws SQLException {
96
* @throws SQLException If an error occurs.
97
*/
98
public List<QOTWAccount> getTopAccounts(int page, int size) throws SQLException {
99
- try (PreparedStatement stmt = con.prepareStatement("SELECT * FROM qotw_points WHERE points > 0 ORDER BY points DESC LIMIT %d OFFSET %d")) {
+ try (PreparedStatement stmt = con.prepareStatement("SELECT * FROM qotw_points WHERE points > 0 ORDER BY points DESC LIMIT ? OFFSET ?")) {
100
stmt.setInt(1, size);
101
stmt.setInt(2, Math.max(0, (page * size) - size));
102
ResultSet rs = stmt.executeQuery();
0 commit comments