What is the difference between the DriverManager and a DataSource?
The first version of JDBC specified using the class java.sql.DriverManager to create Connections. This turned out to be insufficiently flexible and later versions of the JDBC spec define an additional way to create Connections using DataSources. We recommend that you use DataSources.To get a Connection using the DriverManager, first, you register the OracleDriver:DriverManager.registerDriver(new OracleDriver());You only have to register the driver once. Then call getConnection to create a new connection. There are three getConnection methods:getConnection(String url) getConnection(String url, Properties info) getConnection(string url, String user, String password)each of which returns a connection.DataSources provide a more flexible way to create Connections. Once you have a DataSource, getting a connection from a DataSource is just as easy as using the DriverManager. DataSources were designed to be used with JNDI, but you don’t have to use JNDI to use DataSources. DataSources can do t