Databeans are nothing but Java Bean which provides dynamic data to the JSP. There are 3 different type of Databeans in Webpshere
Smart Databean
A smart data bean uses a lazy fetch method to retrieve its own data, meaning, this data bean will fetch data from DB as and when required. Normally, this type of databean will implement
com.ibm.commerce.SmartDataBean interface and will extend the access bean corresponding to the Entity bean we want this data bean to represent. A Smart databean need not extend a access bean and can be used for some other purpose. In that case, we need to extend the command SmartDataBeanImpl.
We can populate the data from DB using the access bean methods or you can do it from the populate() method.
Access Control in SmartDataBean
Access control can be enforced on a data bean level when using the smart data bean
Command Databean
A command data bean relies on a command to retrieve its data and is a more lightweight data bean. The command retrieves all attributes for the data bean at once, regardless of whether the JSP page requires them. As a result, for JSP pages that use only a selection of attributes from the data bean, a command data bean may be costly in terms of performance time. To implement this type of bean, we must have a interface and implementation class just like Controoler commands but this shoulf implement the DataBeanCommand interface and extend DataBeanCommandImpl implementation class
Command data beans can also extend from their corresponding access beans and implement the com.ibm.commerce.CommandDataBean interface
Access Control in CommandDataBean
Access control cannot be enforced on a data bean level
Input Databean
A data bean implementing the InputDataBean interface retrieves data from the URL parameters or attributes set by the view.
Attributes defined in this interface can be used as primary key fields to fetch additional data. When a JSP page is invoked, the generated JSP servlet code populates all the attributes that match the URL parameters, and then activates the data bean by passing the data bean to the data bean manager. The data bean manager then invokes the data bean's setRequestProperties() method (as defined by the com.ibm.commerce.InputDataBean interface) to pass all the attributes set by the view. It should be noted that the following code is required in order for the data bean to be activated:
com.ibm.commerce.beans.DataBeanManager.activate(data_bean, request, response)
where data_bean is the data bean to be activated, request is an HTTPServletRequest object, and response is an HTTPServletResponse object.