Advanced Java Question:

Why use a datasource when you can directly specify a connection details? (in a J2EE application)?

Tweet Share WhatsApp

Answer:

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.

Download Advanced Java PDF Read All 24 Advanced Java Questions
Previous QuestionNext Question
Can we have more than one action servlet?If I define a method in JSP scriplet <%..%>, where will it go after translation into a servlet?