EJB Server methods can return tabular data to the calling client. This feature can be useful for the following reasons:
Use with data-aware controls Some front-end tools provide objects that can automatically display a result set. For example, in a PowerJ application, you can pass the result set obtained from an EJB Server method invocation to a PowerJ Query object or DataWindow, and it will display the rows.
Efficiency For tasks that require returning tabular data, using an EJB Server result set is the most efficient alternative. Common uses of result sets include menu and pick-list population. For example, in an online clothing catalog, you need to list in-stock sizes for each item.
The EJB Server result set allows data to be sent all at once (rather than requiring a get-next-row method and one client-server round trip per method). A large EJB Server result set can be sent with less overhead than is required to encapsulate tabular data as an object and send a serialized version of the object to the client.
Each component model provides an interface that allows you to define result sets from scratch or to forward results from a database query directly to the client.