Skip to content

Commit

Permalink
Avoid hardcoding database driver name.
Browse files Browse the repository at this point in the history
  • Loading branch information
k-tamura committed Jan 25, 2017
1 parent f7a730a commit 1efb39d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1efb39d

Please sign in to comment.