Home Struts Hibernate-spring DAO Layer explained
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

DAO Layer explained

Advertisement
In this section we will explain you the DAO Layer of our application.

DAO Layer explained

     

In this section we will explain you the DAO Layer of our application.

 

DAO Layer Explained

 

DAO stand for Data Access Object, it is design pattern. The DAO contains a connection to a database and basic operation on the database. The other layer of the application can interact with the database by making an object of  DAO class and calling their required method only. It is an important part of the application. It completely hides the data access logic / code from other part of the application. The user / developer can only access their code through their API.

 

Data Access Object is a technique which separate the data access logic and object persistence. It also provides the flexibility to change application prospective without effecting rest of the part of the application. It provides a very simple and consistence API. Because of its simplicity it has become a mandatory parts of a web application.

 

   
   Data Access Object

 

The DAO centralize all the operation on the database.

 

In the present project the DAO class gets connection from the connection factory class (It holds a connection). The bean class gives the data on which operation is performed. Finally DAO class performs the operation on the database and returns the response to the other layer of the application. The internal processing of Data Access Object is given below.

   

DAO Internal Processing

 

One of the great advantage of DAO is the, you do not require to write a code for database connection on every where, you just make an object of DAO class and call the required method to perform operation on database.

 

One of the great advantage of DAO is the, you do not require to write a code for database connection on every where, you just make an object of DAO class and call the required method to perform operation on database.

Advertisements

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: March 17, 2005

Ask Questions?    Discuss: DAO Layer explained   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
saikumar
August 18, 2011
code for registration form with dao classes

can anyone provide sample application code including dao classes for performing operations on database through struts ...thank you
DMCA.com