Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

why we use entity bean ?  RSS feed

 
namita pa
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
can anybody tell why we use enity bean and how do we map the fields in the table using entity beans :-(
Any site giving the details of implementation will be a great help
thanks
namita

------------------
 
shishir p
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Namita !
As per EJB 2.0 there r 3 types of beans

1) Session Beans
2) Entity Beans
3) Message Beans
Entity Beans r divided into two types

1) BMP : Bean Managed Persistance
2) CMP : Container Managed Persistance
In the BMP Entity Beans u ll get a connection to ur database from the application server u r using, in case of weblogic u ll ve to define ur pool in the properties file.
in ur bean u can get this connection directly from the pool or using datasource object.
e.g. Connection con = DriverManager.getConnection("jdbc:weblogic ool:ur_pool_name");

In CMP ur connections will be taken care by the container. u ll just ve to map ur table fields for selection.
U can access the databse through ur session beans but with direct connection. ur server ll not take care of ur connection management.

 
namita pa
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks shishir
------------------
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!