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

If we opened windows notepad 4 times, does it starts 4 processes or 4 threads?

1 Answers  


1) Scenario: I developed my application on local system and everything is perfect and tested. Now on UAT this application is deployed on clustered server environment. They are logical or physically clustered. But application is not working over there.  What is the issue with application?  What are the first things which come in your mind?

1 Answers   L&T,


How many times may an objects finalize() method be invoked by the garbage collector?

0 Answers  


Does Java pass arguments by value or reference?

5 Answers   HeadStrong,


Explain ioc concept?

0 Answers  






int x=5,i=1,y=0; while(i<=5) { y=x++ + ++x; i=i+2; } System.out.println(x); System.out.println(y); System.out.println(i); How to solve this? Please explain!

0 Answers  


What is a task?s priority?

1 Answers  


What method is invoked to cause an object to begin executing as a separate thread?

0 Answers  


What is the argument type of a programs main() method?

0 Answers  


What is daemon thread?

3 Answers  


Why won’t the jvm terminate when I close all the application windows?

0 Answers  


If I wanted to use a solarisui for just a jtabbedpane, and the metal ui for everything else, how would I do that?

0 Answers  


Categories