You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In DatabaseInfoRetriever, the two calls to DriverManager.getDriver(url) to get the driver cause some annoyance with Sybase, notably since different DBMS types use the same jdbc:sybase:Tds format, and since even different jdbc driver classes (notably the jdbc3 vs 4 driver) use the same url. For running multiple deployments in the same JVM across databases, this causes issues
It would be nice to be able to pass in the driver class directly, as to avoid the DriverManager lookup logic. I call the SchemaCrawler crawl() method to get data from SchemaCrawler, so I think it is just a matter of propagating that parameter through
The snippet below is what I'd replace the calls to DriverManager with. The method below would fall back to DriverManager.getDriver if the parameter isn't specified
private Driver getDriver(String url) throws SQLException {
return Optional.ofNullable(driverClassParam) // TODO determine how to pass the driverClass in
.map(driverClass -> {
try {
return driverClass.getDeclaredConstructor().newInstance();
} catch (InstantiationException | NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
throw new RuntimeException(e);
}
})
.orElse(DriverManager.getDriver(url));
}
The text was updated successfully, but these errors were encountered:
@shantstepanian - it is such a bummer that the JDBC specification does not provide a clean way to obtain the JDBC driver from it's API. I have modified the DatabaseServerType to take a third constructor parameter for the driver class name. The code changes are committed, and there are unit tests to validate the new behavior. Please take a look at the commit that fixes the issue - the code changes are not too many.
In DatabaseInfoRetriever, the two calls to DriverManager.getDriver(url) to get the driver cause some annoyance with Sybase, notably since different DBMS types use the same jdbc:sybase:Tds format, and since even different jdbc driver classes (notably the jdbc3 vs 4 driver) use the same url. For running multiple deployments in the same JVM across databases, this causes issues
It would be nice to be able to pass in the driver class directly, as to avoid the DriverManager lookup logic. I call the SchemaCrawler crawl() method to get data from SchemaCrawler, so I think it is just a matter of propagating that parameter through
The snippet below is what I'd replace the calls to DriverManager with. The method below would fall back to DriverManager.getDriver if the parameter isn't specified
The text was updated successfully, but these errors were encountered: