From 27544accb1cf90853ad0e49562de298153e3bf02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Mon, 24 Oct 2022 21:36:18 +0200 Subject: [PATCH] Fix SQL return value --- .../wtf/beatrice/nounspicker/utils/DatabaseManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/wtf/beatrice/nounspicker/utils/DatabaseManager.java b/src/main/java/wtf/beatrice/nounspicker/utils/DatabaseManager.java index 6158e41..8c1922e 100644 --- a/src/main/java/wtf/beatrice/nounspicker/utils/DatabaseManager.java +++ b/src/main/java/wtf/beatrice/nounspicker/utils/DatabaseManager.java @@ -145,7 +145,8 @@ public class DatabaseManager pStatement.setString(1, pronoun); pStatement.setString(2, format); pStatement.setInt(3, pronounId); - return pStatement.execute(); + pStatement.executeUpdate(); + return true; } catch (SQLException e) { logger.err(e.getMessage()); @@ -200,7 +201,7 @@ public class DatabaseManager for(String q : queries) { try(Statement stmt = dbConnection.createStatement()) { - stmt.execute(q); + stmt.executeUpdate(q); } catch (SQLException e) { logger.err(e.getMessage()); return false; @@ -224,7 +225,8 @@ public class DatabaseManager pStatement.setInt(1, mainPronounId); pStatement.setInt(2, secondaryPronounId); pStatement.setString(3, playerName); - return pStatement.execute(); + pStatement.executeUpdate(); + return true; } catch (SQLException e) { logger.err(e.getMessage()); }