Visual SQL Editor UI Specification



This document describes the interface for accessing and using the Visual SQL Editor. Details are available in Visual SQL Editor Functional Specification.

Use Cases and Scenarios

Visually edit a SQL statement in a visual web application

Modify (customize) the SQL query that is bound to a visual component in an application.


  • Open a visual web application that uses databinding
  • Open Project Outline.
  • Find the bean that contains the RowSet that is bound to the component.
  • Right-Click, "Edit SQL Statement".
  • Use the Visual Query Editor to make changes, in any of the input panes, or to execute the query and display results in the Result Pane.

Whenever the SQL statement is changed in the VisualSQLEditor, the command property of the RowSet is updated. This is saved as part of the application.

This has been the only means of accessing the VisualSQLEditor in previous versions of Java Studio Creator/VisualWebPack.

Visually explore the contents of a database

Invoke Visual SQL Editor, either starting with no query, or with a context-dependent default query. Use it to create and test queries.


  • In Runtime, open DB Explorer -> <connection> -> Tables
  • Use the Visual Query Editor to create and run a query

There is no way to save the resulting query.

This is analogous to SQLEditor that is currently accessible from the DB Explorer.

Visual SQL Editor Interface

The VSE consists of four panes, positioned vertically on the screen:

  • Diagram -- a visual representation of a SQL query
  • Grid -- a spreadsheet representation of a query
  • SQL -- a text representation
  • Results -- a spreadsheet representation of a query result

Diagram Pane

The Diagram pane provide an entity-relationship style graphical representation of a SQL query. Nodes of the graph represent tables in the database. Arcs in the graph represent relationships between tables.

Grid Pane

The Grid pane provides a spreadsheet representation of a SQL query. Rows in the Grid pane correspond to columns of the database. Only those columns that are selected for output, or otherwise appear in SQL query, will be displayed in the Grid pane. Columns of the Grid pane will contain information relevant to individual database columns, such as whether the column is selected for output, what criteria are applied to the column in the query, and whether the column is used for sorting or grouping.

SQL Pane

The SQL pane contains the current SQL query. This is either be generated from the contents of the visual panes, or typed by the user.

Test Execution and Results Pane

The Results pane provides a tabular represention for the results of query execution.

Menus and UI Specification

Invoking SQL Editor

Visual Web Application/Outline Window

Location Action Effect
RowSet node RightClick->Edit SQL Statement Invoke VSE on command property

Runtime Window / DB Explorer

Location Action Effect
Table or column node RightClick->Execute Visual Query Invoke VSE on default SQL command

Diagram Pane

Location Action Effect
Background RightClick->Run Query Execute current query and display results in Result window
Background RightClick->Add Table Bring up dialog for choosing table(s) to add
Background RightClick->Group By Add "GROUP BY" clause to query, with all columns from the query output included in the Group By list.
Table (titlebar) RightClick->Remove From Query Deletes the table from the query
Table (column checkbox) LeftClick Toggle whether this column is selected for output
Table (column name) LeftClick->Drag to column of another table Add an equality predicate between the two columns to WHERE clause of query
Join arc LeftClick Edit the properties of this join in the Properties window

Grid Pane

Location Action Effect
Any column except Column, Table LeftClick Make this row/column active for editing
Editing may include: dropdown (Sort Type, Sort Order), Checkbox (Output), Text (Alias, Criteria)
Any column RightClick->Add Query Criteria Bring up Add Query Criteria dialog for specifying condition on this row/column

SQL Text Pane

Location Action Effect
Background RightClick->Parse Query Parse current query and update other windows
Background RightClick->Run Query Execute current query and display results in Result window

Text Execution and Results Pane

Location Action Effect
Any cell RightClick->Copy Cell Value Copy contents of current cell to clipboard
Any cell RightClick->Copy Row Values Copy contents of current row to clipboard
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo