• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

DAO and Bean Managed

 
Ranch Hand
Posts: 647
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the difference between the DAO and bean managed persistence?

Thanks,
Trupti
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 647
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Hey, sticks and stones baby. And maybe a wee mention of my stuff:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic