Sun Java Studio Creator 2 – Online Help
 

Data Source Tasks: Quick Reference

See Also

This topic describes common tasks that you can perform with data sources. For more detailed information, click the links in the right column.

To perform this task... Follow these steps
Add a data source to the Servers window
  1. In the Servers window, right-click the Data Sources node and choose Add Data Source.
     
  2. In the Add Data Source dialog box, specify the database information.
     
  3. Click Test Connection to verify that the information was entered correctly.
     
  4. Click Add.
     
Add or edit a database server type
  1. In the Servers window, right-click the Data Sources node and choose Edit Database Server Types.
     
  2. In the Edit Database Server Types dialog box, click New.
     
  3. In the Locate JDBC JAR Files dialog box, find the necessary JAR files.
     
  4. In the Edit Database Server Types dialog box, if it is not correct, enter or change the server information.
     
Add a database table to a page
  1. In the Servers window , expand the Data Sources nod.
     
  2. Expand the database-name node.
     
  3. Expand the Tables node.
     
  4. Drag the database table or view into the Visual Designer, or right-click the database table or view node and choose Add to Page.
     
Bind data to a Table component
  1. Add the Table component to the page.
     
  2. Drag the database table or view from the Servers window to the Visual Designer and drop the database table or view onto the Table component.
     
  3. If necessary, set the table layout.
     
Bind data to list components (such as Listbox) in the Basic category of the Palette
  1. Drag the database table or view from the Servers window and drop it onto the page.
     
  2. Right-click the component to which you want to bind the data and choose Bind to Data.
     
Bind data to simple components (such as Button) in the Basic category of the Palette
  1. Drag the database table or view from the Servers window to the Visual Designer.
     
  2. Right-click the component to which you want to bind the data and choose Bind to Data.
     
  3. In the Bind to Data dialog box, choose the data provider and data field to which the bind the component.
     
Create a data source alias
  1. In the Servers window, right-click the Data Sources node and choose Add Data Source Alias.
     
  2. In the Data Source Alias Definition dialog box, enter the alias name.
     
  3. Choose the data source the alias should reference and click Add.
     
Create an SQL query
  1. Add a database table or view to a page.
     
  2. In the Outline window, right-click the table-nameRowSet item and choose Edit SQL Statement.
     
  3. In the Query Editor, edit the query.
     
Delete a data source alias
  • In the Servers window, right-click the data-source-alias-name and choose Remove Data Source.
     
Delete a database server type
  1. In the Servers window, right-click the Data Sources node and choose Edit Database Server Types.
     
  2. In Edit Database Server Types dialog box, select the display name of the database server type to delete and click Delete.
     
Delete a database table from the page
  • In the Outline window, right-click the table-nameRowSet item and choose Delete.
     
  • In the Outline window, right-click the table-nameDataProvider item and choose Delete.
     
Edit a database server type
  1. In the Servers window, right-click the Data Sources node and choose Edit Database Server Types.
     
  2. In the Edit Database Server Types dialog box, click New.
     
  3. In the Locate JDBC JAR Files dialog box, find the necessary JAR files and click Open.
     
  4. In the Edit Database Server Types dialog box, enter or change the server information and click Close.
     
Export a set of data sources
  1. In the Servers window, right-click the Data Sources node and choose Export Data Sources.
     
  2. In the Export Data Sources dialog box, select the data sources to export.
     
  3. Enter the location of the file to which to export the data sources and click OK.
     
  4. Make the exported file available to the developers who need it.
     
Import a set of data sources
  1. In the Servers window, right-click the Data Sources node and choose Import Data Sources.
     
  2. In the Open dialog box, find the file to import and click Open.
     
  3. In the Import Data Sources dialog box, select one or more data sources to import and click OK.
     
Modify data source properties
  1. In the Servers window, expand the Data Sources node.
     
  2. Right-click the data source to modify and choose Modify Data Source.
     
  3. Modify the data source information and click Modify.
     
Remove a data source
  1. In the Servers window, expand the Data Sources node.
     
  2. Right-click the data source that you want to remove and choose Remove Data Source.
     
View data in a database table
  1. In the Servers window, right-click the database table name and choose View Data.
     
  2. If desired, in the Query window, modify the query to specify the data to retrieve.
     
  3. Click Run Query.
     
See Also
About Components and Data
About Components
About Binding Components to Data
Working With Data Sources
 
 
 
Legal Notices. Copyright © 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Close