From fad0bef787b03418b07bffd0d09b4692e77ea85e Mon Sep 17 00:00:00 2001 From: Smudge <68658429+smuddgge@users.noreply.github.com> Date: Sat, 8 Jun 2024 14:10:32 +0100 Subject: [PATCH] Fixed a few database issues --- dependency-reduced-pom.xml | 2 +- pom.xml | 4 ++-- src/main/java/com/github/smuddgge/leaf/Leaf.java | 15 +++++++-------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml index 59d311a..430eaa9 100644 --- a/dependency-reduced-pom.xml +++ b/dependency-reduced-pom.xml @@ -4,7 +4,7 @@ com.github.smuddgge Leaf Leaf - 5.2.0 + 5.2.1 A velocity utility plugin diff --git a/pom.xml b/pom.xml index 28ce278..e64f61f 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github.smuddgge Leaf - 5.2.0 + 5.2.1 jar Leaf @@ -97,7 +97,7 @@ com.github.smuddgge SquishyDatabase - 4.0.0 + 4.1.0 diff --git a/src/main/java/com/github/smuddgge/leaf/Leaf.java b/src/main/java/com/github/smuddgge/leaf/Leaf.java index a25a3d6..e87a55f 100644 --- a/src/main/java/com/github/smuddgge/leaf/Leaf.java +++ b/src/main/java/com/github/smuddgge/leaf/Leaf.java @@ -53,7 +53,7 @@ @Plugin( id = "leaf", name = "Leaf", - version = "5.2.0", + version = "5.2.1", description = "A velocity utility plugin", authors = {"Smudge"} ) @@ -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; @@ -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()) {