From df956d42d48ba70ce22125179403db5578736850 Mon Sep 17 00:00:00 2001 From: Louis Vallat Date: Wed, 28 Oct 2020 00:07:35 +0100 Subject: [PATCH] Set all languages elements in lowercase to ease comparison for later use Signed-off-by: Louis Vallat --- .../xyz/vallat/louis/database/LanguageManager.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/xyz/vallat/louis/database/LanguageManager.java b/src/main/java/xyz/vallat/louis/database/LanguageManager.java index 022812f..387dc66 100644 --- a/src/main/java/xyz/vallat/louis/database/LanguageManager.java +++ b/src/main/java/xyz/vallat/louis/database/LanguageManager.java @@ -105,11 +105,11 @@ public final class LanguageManager { String alpha2b, String english, String french) throws SQLException { String insert = "INSERT INTO languages(alpha3_b, alpha3_t, alpha2, english, french) VALUES(?, ?, ?, ?, ?);"; try (PreparedStatement stmt = connection.prepareStatement(insert)) { - stmt.setString(1, alpha3b); - stmt.setString(2, alpha3t.isBlank() ? null : alpha3t); - stmt.setString(3, alpha2b.isBlank() ? null : alpha2b); - stmt.setString(4, english); - stmt.setString(5, french); + stmt.setString(1, alpha3b.toLowerCase()); + stmt.setString(2, alpha3t.isBlank() ? null : alpha3t.toLowerCase()); + stmt.setString(3, alpha2b.isBlank() ? null : alpha2b.toLowerCase()); + stmt.setString(4, english.toLowerCase()); + stmt.setString(5, french.toLowerCase()); stmt.executeUpdate(); } }