Skip to content

Commit

Permalink
Renamed databaseMode variable to databaseModeName.
Browse files Browse the repository at this point in the history
  • Loading branch information
imDMK committed Aug 11, 2023
1 parent 6c5967c commit 42705bf
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public void connect() throws SQLException {
this.dataSource.addDataSourceProperty("prepStmtCacheSqlLimit", 2048);
this.dataSource.addDataSourceProperty("useServerPrepStmts", true);

String databaseMode = this.databaseConfiguration.databaseMode.name().toUpperCase();
switch (DatabaseMode.valueOf(databaseMode)) {
String databaseModeName = this.databaseConfiguration.databaseMode.name().toUpperCase();
switch (DatabaseMode.valueOf(databaseModeName)) {
case SQLITE -> {
this.dataSource.setDriverClassName("org.sqlite.JDBC");
this.dataSource.setJdbcUrl("jdbc:sqlite:" + this.dataFolder + "/database.db");
Expand All @@ -53,12 +53,12 @@ public void connect() throws SQLException {
this.dataSource.setJdbcUrl("jdbc:mariadb://" + this.databaseConfiguration.hostname + ":" + this.databaseConfiguration.port + "/" + this.databaseConfiguration.database);
}

default -> throw new IllegalStateException("Unknown database mode: " + databaseMode);
default -> throw new IllegalStateException("Unknown database mode: " + databaseModeName);
}

this.connectionSource = new DataSourceConnectionSource(this.dataSource, this.dataSource.getJdbcUrl());

this.logger.info("Connected to " + databaseMode + " database.");
this.logger.info("Connected to " + databaseModeName + " database.");
}

public void close() {
Expand Down

0 comments on commit 42705bf

Please sign in to comment.