From d591c3f5f0fbe7d45d5522fca6ccbb5fa08c045c Mon Sep 17 00:00:00 2001 From: oshawott Date: Sun, 10 Apr 2022 01:18:52 +0000 Subject: [PATCH] Update Voucher.java --- src/main/java/com/eu/habbo/habbohotel/catalog/Voucher.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/catalog/Voucher.java b/src/main/java/com/eu/habbo/habbohotel/catalog/Voucher.java index b5e93b13..468e2a2b 100644 --- a/src/main/java/com/eu/habbo/habbohotel/catalog/Voucher.java +++ b/src/main/java/com/eu/habbo/habbohotel/catalog/Voucher.java @@ -38,7 +38,8 @@ public class Voucher { } private void loadHistory() { - try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT * FROM voucher_history")) { + try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT * FROM voucher_history WHERE voucher_id = ?")) { + statement.setInt(1, this.id); try (ResultSet set = statement.executeQuery()) { while (set.next()) { this.history.add(new VoucherHistoryEntry(set));