Interviewer And Interviewee Guide

Advanced Java Interview Question:

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

Submitted by: Administrator
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.
Submitted by: Administrator

The Datasource objects handles connection pooling which is a much more efficient way to access the database than using the same connection/getting a new one.
Submitted by: Bennyz

Read Online Advanced Java Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.