diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/juick/CrosspostComponent.java | 3 | ||||
-rw-r--r-- | src/main/java/com/juick/PushComponent.java | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/com/juick/CrosspostComponent.java b/src/main/java/com/juick/CrosspostComponent.java index 1df68493f..f6d830ec2 100644 --- a/src/main/java/com/juick/CrosspostComponent.java +++ b/src/main/java/com/juick/CrosspostComponent.java @@ -125,11 +125,14 @@ public class CrosspostComponent implements ServletContextListener, Stream.Strea public void setupSql(String host, String username, String password, String database) { try { + Class.forName("com.mysql.jdbc.Driver"); sql = DriverManager.getConnection( String.format("jdbc:mysql://%s/%s?autoReconnect=true&user=%s&password=%s", host, database, username, password)); } catch (SQLException e) { logger.log(Level.SEVERE, e.getMessage(), e); + } catch (ClassNotFoundException e) { + logger.log(Level.SEVERE, e.getMessage(), e); } } diff --git a/src/main/java/com/juick/PushComponent.java b/src/main/java/com/juick/PushComponent.java index a813f1a28..7b6c90ec1 100644 --- a/src/main/java/com/juick/PushComponent.java +++ b/src/main/java/com/juick/PushComponent.java @@ -125,11 +125,14 @@ public class PushComponent implements ServletContextListener, Stream.StreamListe public void setupSql(String host, String username, String password, String database) { try { + Class.forName("com.mysql.jdbc.Driver"); sql = DriverManager.getConnection( String.format("jdbc:mysql://%s/%s?autoReconnect=true&user=%s&password=%s", host, database, username, password)); } catch (SQLException e) { logger.log(Level.SEVERE, e.getMessage(), e); + } catch (ClassNotFoundException e) { + logger.log(Level.SEVERE, e.getMessage(), e); } } |