• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DAO and Bean Managed

 
trupti nigam
Ranch Hand
Posts: 627
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between the DAO and bean managed persistence?

Thanks,
Trupti
 
rottscha rotti
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
the best to combine these two technologies. In BMP you write your own database dependant SQL code. By using a DAO you put all the database dependant SQL statements and connection handling in the DAO class . When you change the Database you only need to make corrections in the dao class not in the bean.

that's it - rr
 
trupti nigam
Ranch Hand
Posts: 627
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by rottscha rabbit:

Hi,
the best to combine these two technologies.
---------------------------------------------------------------------
Can you explain how can this be achieved?
======================================================================
In BMP you write your own database dependant SQL code. By using a DAO you put all the database dependant SQL statements and connection handling in the DAO class
----------------------------------------------------------------------
I think in both cases i.e.in DAO and BMP we need to write our own SQL code.
===========================================================================

. When you change the Database you only need to make corrections in the dao class not in the bean.

that's it - rr


In BMP one has to implement all the methods of the interface.

thanks,
Trupti
 
Rick O'Shay
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by trupti nigam:
What is the difference between the DAO and bean managed persistence?

Thanks,
Trupti


Data access objects are a pattern that you can use with or without bean managed persistence. Bean managed persistence just says that you're not allowing the container to manage persistence for you.
 
Bhupesh Arya
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DAO is a pattern to encapsulate all your data access logic ( all ur SQL code). As the name indicates BMP is Bean Managed Persistence, which means that the persistence will be managed by the bean, ie the programmer has to write the SQL code. It is advisable to use DAO pattern when using BMP.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic