From 1efb39d05ae1f323c718d58fdaa645b4ea257a9a Mon Sep 17 00:00:00 2001 From: Kohei Tamura Date: Wed, 25 Jan 2017 10:55:59 +0900 Subject: [PATCH] Avoid hardcoding database driver name. --- .../easybuggy/troubles/DBConnectionLeakServlet.java | 2 +- .../org/t246osslab/easybuggy/troubles/DeadlockServlet2.java | 4 ++-- .../easybuggy/vulnerabilities/SQLInjectionServlet.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/t246osslab/easybuggy/troubles/DBConnectionLeakServlet.java b/src/main/java/org/t246osslab/easybuggy/troubles/DBConnectionLeakServlet.java index 1c0f89c7..5ed2419a 100644 --- a/src/main/java/org/t246osslab/easybuggy/troubles/DBConnectionLeakServlet.java +++ b/src/main/java/org/t246osslab/easybuggy/troubles/DBConnectionLeakServlet.java @@ -39,7 +39,7 @@ protected void service(HttpServletRequest req, HttpServletResponse res) throws S if (dbDriver != null && !dbDriver.equals("")) { try { - Class.forName("com.mysql.jdbc.Driver"); + Class.forName(ApplicationUtils.getDatabaseDriver()); } catch (ClassNotFoundException e) { Logger.error(e); } diff --git a/src/main/java/org/t246osslab/easybuggy/troubles/DeadlockServlet2.java b/src/main/java/org/t246osslab/easybuggy/troubles/DeadlockServlet2.java index afe738c9..b6a03ce6 100644 --- a/src/main/java/org/t246osslab/easybuggy/troubles/DeadlockServlet2.java +++ b/src/main/java/org/t246osslab/easybuggy/troubles/DeadlockServlet2.java @@ -80,7 +80,7 @@ class EmbeddedJavaDb2 { try { if (dbDriver != null && !dbDriver.equals("")) { try { - Class.forName("com.mysql.jdbc.Driver"); + Class.forName(ApplicationUtils.getDatabaseDriver()); } catch (ClassNotFoundException e) { Logger.error(e); } @@ -130,7 +130,7 @@ public String update(int[] ids, Locale locale) { try { if (dbDriver != null && !dbDriver.equals("")) { try { - Class.forName("com.mysql.jdbc.Driver"); + Class.forName(ApplicationUtils.getDatabaseDriver()); } catch (ClassNotFoundException e) { Logger.error(e); } diff --git a/src/main/java/org/t246osslab/easybuggy/vulnerabilities/SQLInjectionServlet.java b/src/main/java/org/t246osslab/easybuggy/vulnerabilities/SQLInjectionServlet.java index 685c1944..e1eecafd 100644 --- a/src/main/java/org/t246osslab/easybuggy/vulnerabilities/SQLInjectionServlet.java +++ b/src/main/java/org/t246osslab/easybuggy/vulnerabilities/SQLInjectionServlet.java @@ -78,7 +78,7 @@ class EmbeddedJavaDb { String dbDriver = ApplicationUtils.getDatabaseDriver(); if (dbDriver != null && !dbDriver.equals("")) { try { - Class.forName("com.mysql.jdbc.Driver"); + Class.forName(ApplicationUtils.getDatabaseDriver()); } catch (ClassNotFoundException e) { Logger.error(e); }