1) Do not doublepost the same question over all forums. This will waste other's time which is rude.
2) Do not impatiently kick topics up. Chance to get ignored is bigger.
3) Write proper English and use proper Java terms. Your question is vague.
If you elaborate the question more clearly, you would likely generate more useful response.
Your last sentence "I want to know upon calling a DAO interface from the servlets (Correct me if i am wrong) how the DAO implementation class would be get called upon ? " is a bit too vague. Af far this sounds like that you wanted to know how something like "MyDAO myDAO = new MyClass();" is to be done, but this is too obvious that I am unsure about what you're actually asking.
PavanPL KalyanK
Ranch Hand
Joined: Feb 28, 2009
Posts: 212
posted
0
I will let you explain what is the confusion going on my mind :
if(reques.getParameter("ButtonName").equals("SerachEmployees"))
{
// Here i am calling a method on the DAO interface
List list =MyDAO.getData(Employee employee);
}
How the implementation class is getting called upon ?
what i am doing is right or wrong ?
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
0
You just instantiate it. You can do it yourself or using a DAO factory based on the input or configuration parameters. You can do that in the init() method of the servlet and assign it as instance variable of the servlet.
PavanPL KalyanK
Ranch Hand
Joined: Feb 28, 2009
Posts: 212
posted
0
Didn't get you at all . Is there any link or tutorial for this ?
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
0
I now see a private message from you with the question not to respond on your posts anymore. Not that this is a big problem, you've it in your hands, but what on earth happened?
At any way, here is a simple (pseudo)example of just instantiating it in the servlet's init().
Bauke Scholtz wrote:I now see a private message from you with the question not to respond on your posts anymore. Not that this is a big problem, you've it in your hands, but what on earth happened?
I did a lot of googling before sleep, but didn't found suitable answer so the reason posted on to the site and in the morning saw the reply from you . Thanks .