diff --git a/src/main/java/me/paradoxpixel/themepark/database/Database.java b/src/main/java/me/paradoxpixel/themepark/database/Database.java index 9bcb549..c73653f 100644 --- a/src/main/java/me/paradoxpixel/themepark/database/Database.java +++ b/src/main/java/me/paradoxpixel/themepark/database/Database.java @@ -43,7 +43,7 @@ public class Database { public void connect() { try { Class.forName("com.mysql.jdbc.Driver").newInstance(); - connection = DriverManager.getConnection("jdbc:mysql://" + host + ":" + port + "/" + database, user, password); + connection = DriverManager.getConnection("jdbc:mysql://" + host + ":" + port + "/" + database + "?useSSL=false", user, password); startPool(); } catch(Exception e) { @@ -128,69 +128,4 @@ public class Database { return false; } - public int executeUpdate(String query, HashMap objects) { - if(query == null || query.isEmpty()) - return 0; - - if(!enabled) - return 0; - - if(!connected()) - connect(); - - if(!connected()) - return 0; - - stopPool(); - try { - PreparedStatement statement = connection.prepareStatement(query); - for(Map.Entry entry : objects.entrySet()) - statement.setObject(entry.getKey(), entry.getValue()); - - int i = statement.executeUpdate(); - statement.close(); - startPool(); - - return i; - } catch(Exception e) { - e.printStackTrace(); - } - - startPool(); - return 0; - } - - public ResultSet executeQuery(String query, HashMap objects) { - if(query == null || query.isEmpty()) - return null; - - - if(!enabled) - return null; - - if(!connected()) - connect(); - - if(!connected()) - return null; - - stopPool(); - try { - PreparedStatement statement = connection.prepareStatement(query); - for(Map.Entry entry : objects.entrySet()) - statement.setObject(entry.getKey(), entry.getValue()); - - ResultSet result = statement.executeQuery(); - statement.close(); - startPool(); - - return result; - } catch(Exception e) { - e.printStackTrace(); - } - - startPool(); - return null; - } - }