Hello Seem to be a hardest word

Just another WordPress.com weblog

Data Table Components in Sun Java(TM) Studio Creator 2

Background
Sun Java Studio Creator 2 introduced new “basic” components to the Palette, while retaining the JavaServer Faces components the previous version, called “standard” components.

This technical tip explains how to bind a database table (that you have dropped on a page in the Java Studio Creator 2 IDE) to a Data Table component, which is a standard component from the previous version of the IDE, Java Studio Creator 2004Q2. Standard components have been maintained in Java Studio Creator 2 so that pages from projects developed with Java Studio Creator 2004Q2 can work without modifications. You can find these standard components on the Palette in the Standard section.

In Java Studio Creator 2, data provider components bind the Table component to a database table. That is, when you drop a database table on a Table component on a page, the IDE uses a data provider to bind the Table component to the database table.

If you use a Data Table component from the Standard section of the Palette, the Data Table component cannot be bound to the database table using a data provider. However, by manually binding the component to the database table, it is possible to create pages that use both standard components and basic components. Follow the instructions below to bind a database table to a Standard Data Table component.

Chary Kanaparthi
Chary Kanaparthi is a member of the Quality Engineering team for Java Studio Creator.

 

Binding a Data Table Component to a Database Table

You can bind a Data Table component to a database table using the Table Layout dialog. You actually bind the Data Table component to the database table’s RowSet. Follow the steps outlined here to see how this is accomplished.

  1. Drop a Data Table from the Standard section of the Palette on to a page in the Design window.
  2. Add a database table to the page. In the Servers window, right-click a database table from the Data Sources node and select Add to Page from the context menu.
  3. Select the Data Table component. You can select the component in the Outline window or on the Design window page. Right-click to bring up its context menu and click Table Layout.
  4. From the Table Layout dialog, select the appropriate RowSet for the Get data from: prompt. Click OK. Figure 1 shows personRowSet selected from the dropdown list.
Bind Table to RowSet

Figure 1: Bind Table to RowSet

 
After the operation completes, the Data Table component on the page changes to reflect the binding to the database table. The Data Table is now bound to the PERSON database table, personRowSet, as shown in Figure 2.

Standard Data Table Component After Binding

Figure 2: Standard Data Table Component After Binding

 

More Developer Resources

 
For more tech tips, articles, forums, tutorials, weblogs, and other expert advice for developers, visit the Java Studio Creator developer resources on the Sun Developer Network (SDN) at http://developers.sun.com/jscreator/

Tháng Ba 30, 2008 - Đăng bởi fate | JDBC | | No Comments Yet

Chưa có phản hồi.

Để lại phản hồi

Bạn phải đăng nhập để gửi phản hồi