Advanced Customization > Info*Engine User’s Guide > Info*Engine Data Management > About Info*Engine Data Management > Groups of Objects and the Virtual Database > Basic Group Creation and Display
  
Basic Group Creation and Display
Groups of objects are stored in the VDB so that other webjects can make use of the information. The following scenario demonstrates how you can use the VDB to pass information from a task webject to a display webject in order to perform a database query and return the results to the browser.
In this scenario, assume that the following sequence of events comprise the actions required in the scenario:
1. From the browser, a user enters a URL that identifies an Info*Engine JSP page.
2. A task webject on the page executes a query to a database.
3. The output from the task webject is formatted by a display webject and is returned to the browser.
To accomplish this scenario, start by authoring a JSP page that queries a database for information about employees. The Query-Objects webject on the page might look like this:
<ie:webject name="Query-Objects" type="OBJ">
   <ie:param name="INSTANCE"  data="com.myHost.Adapter"/>
   <ie:param name="CLASS"     data="salesemp"/>
   <ie:param name="WHERE"     data="()"/>
   <ie:param name="SORTED"    data="ASC"/>
   <ie:param name="SORTBY"    data="ename"/>
   <ie:param name="GROUP_OUT" data="employees"/>
</ie:webject>
This webject executes a query of the salesemp table using the adapter identified in the INSTANCE parameter. The CLASS parameter defines which table should be queried, and because the WHERE parameter does not limit what is returned, all of the data in the table is returned. The SORTED parameter has a value of ASC, which sorts the data returned from the database in ascending order. The SORTBY parameter names the attribute on which sorting is done. In this scenario, the ename attribute set in the SORTBY parameter holds the employee name. Therefore, rather than sorting the information based on the first attribute of each item it finds, sorting is based on the employee names.
After all of the information is gathered from the query, the webject places the group named “employees” in the VDB. This group is then available for use by other webjects. If the query returns the same data as described in the earlier VDB example, you can think of the “employees” group in terms of the following table:
ename
phone
department
title
Burton, Jack
873-2302
Sales
Sales Representative
Law, Gracie
873-2200
Sales
Sales Manager
LoPan, David
873-3313
Sales
Administrative Assistant
Notice that the “ename” column, which contains the Employee Name data, is sorted in ascending order in the VDB.
To view the employee information that is stored in the “employees” group, you can add a display webject to the JSP page. In the display webject, you specify which group to format as the input group. By default, Info*Engine surrounds the data in the group with HTML so it can be displayed. A display webject that is designed to display the information as a table might look like this:
<ie:webject name="Display-Table" type="DSP">
   <ie:param name="GROUP_IN"  data="employees"/>
   <ie:param name="BORDER"    data="1"/>
   <ie:param name="ATTRIBUTE" data="ename,phone,title"
                                   delim=","/>
  <ie:param name="HEADER"    data="Name,Telephone,Title"
                                   delim=","/>
</ie:webject>
The Display-Table webject names three of the four attributes stored in the VDB and specifies header values for the attributes in the ATTRIBUTE and HEADER parameters. The resulting display is the following table, which includes the three attributes for each object under their corresponding header values: