Advanced Java Question:
Download Questions PDF

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

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 Interview Questions And Answers PDF

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?