What is need of DAO? Write one simple DAO example?
Answers were Sorted based on User's Feedback
Answer / naveen kumar v
DAO: Data Access Object. here the main concept of DAO is to
communicate with the database. DAO mainly contains
1.) DAOFactory: this specifies which kind of database
(wether MySQL or ORACLE or MSSQL etc...).
2.) SQLFactory: which extends the DAOFactory. Here we do
all the connection stuffs.deciding te driver, hostname,
URL, username, password etc and also getting the Connection
object.
3.) AdminDAO: this is a interface where we declare all the
methods which we need in our application to perform all the
database related operation.
4.) SQLAdminFactory: this implements the AdminDAO
interface, all its method. this also gets the connection
from SQLFactory.
5.) TransactionControlDAO: here we keep the commit and
roolback methods.
if required...
6) ConnectionConstant: in this file we can mention the file
name (.properties file) where we keep the connection
detals, like hostname, username, password, etc...
| Is This Answer Correct ? | 14 Yes | 4 No |
Answer / ankit
DAO(Data Access logic) provide the machanism to saperate our bussiness logic from data access logic and both code can be change independently that lead to flexibility in our application. and it also provide security because when will see spurce code from web page only the business logic can be seen and cant see the data access logic . and it also provide reusability
| Is This Answer Correct ? | 7 Yes | 0 No |
Which server-side script takes the input from JavaScript, can access the database if it needs to, and processes the data.
How do I find jre path in windows?
what are advantages of HQL? what are advantages of Native SQL? what are advantages of Criteria API?
Explain the OOPS concept in Realtime Scenarion ? Take example as CAR. Please explain indetail ?
What is an algorithm in java collection framework? : java collections
who should use JNDI?
how to deploy the web application ?
What are the types of the main implementing classes in the map interfaces? : java collections
In HashSet duplicates are allowed while adding to the HashSet, but while retreiving the object from HashSet is not shown the duplicate values, WHY ?
whatis arguments &what is default argument
How do you debug your java program?
what is filter ?