Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DAO

 
Sridhar Raman
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just read the article from SUN on DAOs
http://developer.java.sun.com/developer/restricted/patterns/DataAccessObject.html
Got a question...
Where does JDBC(or any other J2EE APIs) fit in when the underlying persistent store is an RDBMS? Does DAOs replace the other APIs like JDBC ( sounds unlikely..)? A bit confused here...any help on this?
thanks for your answers
Sridhar
 
Srini Admala
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sridhar,
As you know JDBC abstracts the database access with a common interface for various RDBMS.
DAO is a pattern that abstracts data access mechanism when you have datasource in more than one form viz. RDBMS, OORDBMS, XML Respository, LDAP server etc.
Even in the case of a single datasource, you can use DAO's for data caching for data sets that do not change frequently to improve performance.
DAO's do not replace JDBC or any other J2EE API.
-Srini
 
Sridhar Raman
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Srini. I understand now. I guess DAO is just a design pattern and not an API as such. Got it confused with MS technology such as ADO and DAO. yeah, the DAO object is nothing more than an adapter that will use J2EE APIs like JDBC, JNDI,etc.
-Sridhar-
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic