Sun Java Studio Creator 2 – Online Help
 

Working With Data Sources

The following table shows how to use data sources.

Number one
Add data source to the IDE

Data source node icon

  • To add a single data source to the Servers window:
     
    • In the Servers window, right-click the Data Sources node and choose Add Data Source.
       
    • Fill in the values for the database and click Add.
       
  • To add a set of data sources exported by another developer:
     
    • In the Servers window, right-click the Data Sources node and choose Import Data Sources.
       
    • Find the exported database file and click Open.
       

Number two
Connect database table to page

Data source table icon

  1. In the Servers window, expand the Data Sources node.
     
  2. Expand the data-source-name node and the Tables Node.
     
  3. Drag the database table or view to the Visual Designer.
     

Number three
Define rowset content

rowset icon

  1. In the Outline window, double-click the table-nameRowSet item.
     
  2. In the Query Editor, if the SQL query is not correct, edit it.
     

Number four
Bind data to component

visual editor icon

In the Visual Designer, add the component to the page, then:

Number five
Set event handling

Java code page icon

  • Specify event handling for retrieving, updating, or deleting the data by double-clicking the component to open the Java Editor.
     
 
 
 
Legal Notices. Copyright © 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Close