⟩ Why use a datasource when you can directly specify a connection details? (in a J2EE application)?
Because, it would be really difficult to specify the connection details in every method that access the database. Instead, if we create a data source, it can be used to connect to the database in every method we want.