fall back to DriverManager only if URL is not accepted

This commit is contained in:
User
2020-10-11 08:44:22 +02:00
parent fd7e9dce80
commit 2bc81ad5ae

View File

@@ -362,8 +362,14 @@ public class BasicDataSource implements DataSource {
info.put(entry.getKey(), entry.getValue());
}
}
if (currentDriver != null /* && currentDriver.acceptsURL(dbUrl) */) {
con = currentDriver.connect(dbUrl, info);
try {
if (currentDriver != null) {
con = currentDriver.connect(dbUrl, info);
}
} catch (SQLException e) {
if (currentDriver.acceptsURL(dbUrl)) {
throw e;
}
}
if (con == null) {
con = DriverManager.getConnection(dbUrl, info);