0

Hi all,

Goodday...!

Im delevoping a struts project of my own.
Having doubt in database connection.
Actually where i have to write code for connection,
there itself my doubt starts....
whether i hv to write a connection code in
(1) execute method in Action class, OR in
(2) servlets, OR in
(3) seperate DAO class

Please clarify my doubt.
Servlet is needed or not while using struts.
Java bean class is needed or not while using struts.

Please clarify.
U can reply here or reply to my mail([snipped]).
I have refer many books. But i didnt get the answer to the point.

Im using netbeans.

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by __avd
0

>whether i hv to write a connection code in
(1) execute method in Action class, OR in
(2) servlets, OR in
(3) seperate DAO class

Option is (3) DAO class.

DAO class is an implementation of Model of MVC.

Servlet and struts never involve in design of Model classes. - They acts as a controller.

0

Thanks for your reply adatapost...!!!

But how to write DAO class....
In DAO class, i have to write to db connection right....???
Then where i have to write the definition of the db details (prepared statements).
And how to access...

Can you please tell me the flow of the code...
Can u please spend your 10 minutes time to clarify my doubts....??
Please...!!!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.