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

Is the session factory thread safe?

0 Answers  


When a thread terminates its processing, it enters into what state?

1 Answers  


Why DOM Parser would take more Memory than SAX parser while they are parsing?

3 Answers   OnMobile,


Can I have an action without a form?

0 Answers  


What are the thread-to-thread communcation?

1 Answers  






Is a class a subclass of itself?

0 Answers  


What is deadlock?

2 Answers  


What restrictions are placed on the location of a package statement within a source code file?

0 Answers  


What are the different approaches to represent an inheritance hierarchy?

0 Answers  


What are the steps to write p-to-p model application?

0 Answers  


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

0 Answers  


Where we can write Rmi registry in the code, without having to write it at the command prompt?

0 Answers  


Categories