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 are the services in RMI ?

0 Answers  


what is heepStored?

1 Answers  


How task's priority is used in scheduling?

0 Answers   HCL,


Explain phantom read?

0 Answers  


What are the design considerations while making a choice between using interface and abstract class?

0 Answers  


What is Stream Tokenizer?

0 Answers   TCS,


What is preemptive and Non-preemptive Time Scheduling?

6 Answers   Cognizant,


Difference between JRE and JVM?

3 Answers   HeadStrong, Infotech,


When a thread blocks on i/o?

0 Answers  


What is jboss?

0 Answers  


How JNDI is used in JMS ?

1 Answers  


What are the pros and cons of detached objects?

0 Answers  


Categories