• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

what is the benefits of usinf Entity bean ?

 
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could anyone give me some clarification on using entity beans over a servlet/JSP->JDBC database system ?
It seems to me it is a lots more work to implement entity beans that to use a servlet/JSP->JDBC database system.
Please comments.
Thanks in advance
Ruilin
confused
[This message has been edited by ruilin yang (edited August 21, 2001).]
[This message has been edited by ruilin yang (edited August 21, 2001).]
 
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Essentially, an entity bean is a Java wrapper for a row in a table in a DB.
At least that's how it all began. Your mileage may vary...
Others may enhance upon this very brief explanation...
 
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hello Ruilin,
Entity beans have this feature of caching the requested
records in the application server itself, so that they can be
used in future without having to place another call to the
database. I think this is the main advantage.
Manjunath
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Although you could (and even should in some cases) use session beans to access data. The major advantage of using Entity Beans is that they 'know' when data needs to be persisted i.e. you don�t have to tell your bean when to read a line from the db and when to write data to the database. Their major disadvantage is the fact that they are not as scalable as Stateless Sessions Beans. A query for 1000 records in your DB could mean you would be instantiating 1000 beans in the container.
 
Ranch Hand
Posts: 320
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Another benefit is that you don't have to code all that SQL into an entity bean. You just setup the mapping with the bean abd the database tables that is represents and you're off.
If you get into entity beans make sure you look at Bean Managed and Container Managed. They each have pros and cons.
Some 'watch outs':
CMP -> no guarantee that they can handle complex relations.
BMP -> you are now coding all that sql I said you didn't have to code.
 
reply
    Bookmark Topic Watch Topic
  • New Topic