Why do we use a DataSource instead of a DriverManager?
I am reading the Java JDBC specification (vr. 4) and I encountred this statement: DataSource — this interface was introduced in the JDBC 2.0 Optional Package API. It is preferred over DriverManager because it allows details about the underlying data source to be transparent to the application What I am trying to understand is what the difference is between a Connection and a DataSource , and why it exists. I mean, the block above says that the details about a datasource is transparent to the application, but wouldn't externalizing database properties such as username, password, url etc in a