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



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

Answer / anand

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.

Is This Answer Correct ?    5 Yes 1 No

Post New Answer

More Advanced Java Interview Questions

What is the return type of interrupt method?

2 Answers  


why we use main in java?

4 Answers  


Define prototype?

0 Answers  


Why doesn’t the focus feature on the tag work in every circumstance?

0 Answers  


Is it possible to stop the execution of a method before completion in a sessionbean?

0 Answers  






String is immutable.it is true String can be change to mutable How?

6 Answers   IBM, Professional Access, TCS,


What is the difference between the string and stringbuffer classes?

0 Answers  


Can you write Java code for declaration of multiple inheritance in Java ?

6 Answers   Kingshir, Oracle,


What is the difference between system.out ,system.err and system.in?

0 Answers  


How messaging services are done, before release of JMS?

0 Answers  


Explain Life cycle of Servlet Filter.

2 Answers   InfoBrain, ITC Infotech,


how can u cal servlet from java?

7 Answers  


Categories