From fafc4baaa39ca6b86bb62ae109af3ee925de055f Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Sat, 1 Jul 2023 13:39:34 +0200 Subject: [PATCH] Fixes username and password in H2Connector being mixed up --- .../java/com/craftaro/core/database/H2Connector.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Core/src/main/java/com/craftaro/core/database/H2Connector.java b/Core/src/main/java/com/craftaro/core/database/H2Connector.java index 204c20a3..42ed73bf 100644 --- a/Core/src/main/java/com/craftaro/core/database/H2Connector.java +++ b/Core/src/main/java/com/craftaro/core/database/H2Connector.java @@ -22,14 +22,14 @@ public class H2Connector implements DatabaseConnector { this.plugin = null; int poolSize = 2; - String password = "password"; String username = "username"; + String password = "password"; HikariConfig config = new HikariConfig(); config.setDriverClassName("org.h2.Driver"); config.setJdbcUrl("jdbc:h2:./db_test/CraftaroCoreTest;AUTO_RECONNECT=TRUE;MODE=MySQL;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE"); - config.setPassword(username); - config.setUsername(password); + config.setUsername(username); + config.setPassword(password); config.setMaximumPoolSize(poolSize); try { @@ -49,14 +49,14 @@ public class H2Connector implements DatabaseConnector { this.plugin = plugin; int poolSize = databaseConfig.getInt("Connection Settings.Pool Size"); - String password = databaseConfig.getString("Connection Settings.Password"); String username = databaseConfig.getString("Connection Settings.Username"); + String password = databaseConfig.getString("Connection Settings.Password"); HikariConfig config = new HikariConfig(); config.setDriverClassName("com.craftaro.core.third_party.org.h2.Driver"); config.setJdbcUrl("jdbc:h2:./" + plugin.getDataFolder().getPath().replaceAll("\\\\", "/") + "/" + plugin.getDescription().getName().toLowerCase()+ ";AUTO_RECONNECT=TRUE;MODE=MySQL;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE"); - config.setPassword(username); - config.setUsername(password); + config.setUsername(username); + config.setPassword(password); config.setMaximumPoolSize(poolSize); try {