Fix Java 9 nag and ensure all possible exceptions are handled
@@ -2164,7 +2164,7 @@ public class BasicDataSource implements DataSource, BasicDataSourceMXBean, MBean
// Usage of DriverManager is not possible, as it does not
// respect the ContextClassLoader
// N.B. This cast may cause ClassCastException which is handled below
- driverToUse = (Driver) driverFromCCL.newInstance();
+ driverToUse = (Driver) driverFromCCL.getConstructor().newInstance();
if (!driverToUse.acceptsURL(url)) {
throw new SQLException("No suitable driver", "08001");
}
