In Spring, what is the difference between using DriverManagerDataSource and SimpleDriverDataSource for creating a new datasource given its driverClassName, url, username and password?
For example with DriverManagerDataSource you can do something like:
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName(driverClassName);
dataSource.setUrl(url);
dataSource.setUsername(username);
dataSource.setPassword(password);
While with SimpleDriverDataSource you can do:
SimpleDriverDataSource dataSource = new SimpleDriverDataSource();
Class<? extends Driver> driver = (Class<? extends Driver>) Class.forName(driverClassName);
dataSource.setDriverClass(driver);
dataSource.setUrl(url);
dataSource.setUsername(username);
dataSource.setPassword(password);