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.