Skip to content

Commit

Permalink
Fixed a few database issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Smudgge committed Jun 8, 2024
1 parent 3185c84 commit fad0bef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.github.smuddgge</groupId>
<artifactId>Leaf</artifactId>
<name>Leaf</name>
<version>5.2.0</version>
<version>5.2.1</version>
<description>A velocity utility plugin</description>
<build>
<resources>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.smuddgge</groupId>
<artifactId>Leaf</artifactId>
<version>5.2.0</version>
<version>5.2.1</version>
<packaging>jar</packaging>

<name>Leaf</name>
Expand Down Expand Up @@ -97,7 +97,7 @@
<dependency>
<groupId>com.github.smuddgge</groupId>
<artifactId>SquishyDatabase</artifactId>
<version>4.0.0</version>
<version>4.1.0</version>
</dependency>

<!-- Configuration API -->
Expand Down
15 changes: 7 additions & 8 deletions src/main/java/com/github/smuddgge/leaf/Leaf.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
@Plugin(
id = "leaf",
name = "Leaf",
version = "5.2.0",
version = "5.2.1",
description = "A velocity utility plugin",
authors = {"Smudge"}
)
Expand Down Expand Up @@ -353,12 +353,6 @@ public static boolean isDatabaseDisabled() {
*/
public static void setupDatabase(File folder) {

try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}

// Set up the database.
if (!ConfigDatabase.get().getBoolean("enabled", true)) {
Leaf.database = null;
Expand All @@ -373,8 +367,13 @@ public static void setupDatabase(File folder) {
).build();

} catch (Exception exception) {
exception.printStackTrace();
Console.warn("Unable to create a connection to the database.");
Console.warn("- If you are using mysql make sure the connection string is address:port");
Console.warn("- Ensure you have filled the correct values in the database.yml config");
Console.warn("&7");
Console.warn("Connection String : " + ConfigDatabase.get().getString("connection_string"));
Console.warn("&7");
exception.printStackTrace();
}

if (ConfigDatabase.isDebugMode()) {
Expand Down

0 comments on commit fad0bef

Please sign in to comment.