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.

Recommended Answers

All 3 Replies

>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.

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...!!!

Dear

Read this article. The article was submitted by peter budo and also refere their post. (JSP forum);

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.