Skip to content

Commit

Permalink
0001244: Mariadb driver is chosen even though the MySQL driver is spe…
Browse files Browse the repository at this point in the history
…cified
  • Loading branch information
chenson42 committed May 30, 2013
1 parent 3efd942 commit 63cdfb9
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -52,7 +52,14 @@ public static BasicDataSource create(TypedProperties properties,
Enumeration<Driver> drivers = DriverManager.getDrivers();
while (drivers.hasMoreElements()) {
Driver driver2 = (Driver) drivers.nextElement();
if (!driver2.getClass().equals(driver.getClass())) {
/*
* MySQL and Maria DB drivers cannot co-exist because
* they use the same JDBC URL.
*/
if ((driver.getClass().equals("com.mysql.jdbc.Driver") &&
driver2.getClass().getName().equals("org.mariadb.jdbc.Driver")) ||
(driver.getClass().equals("org.mariadb.jdbc.Driver") &&
driver2.getClass().getName().equals("com.mysql.jdbc.Driver"))) {
DriverManager.deregisterDriver(driver2);
}
}
Expand Down

0 comments on commit 63cdfb9

Please sign in to comment.