An SQLQueryBuilderPane presents an interactive tool for dynamically building SQL queries.
To use an SQLQueryPane, set the connection property. This property can be set using the constructor or the setConnection() method. Use load() to load data needed for the query builder graphical user interface. Use getQuery() to get the SQL query that the user has built.
The following example creates an SQLQueryBuilderPane object and adds it to a frame:
// Create an SQLQueryBuilderPane // object. Assume that "connection" // is an SQLConnection object that is // created and initialized elsewhere. SQLQueryBuilderPane queryBuilder = new SQLQueryBuilderPane (connection); // Load the data needed for the query // builder. queryBuilder.load (); // Add the query builder pane to a // frame. Assume that "frame" is a // JFrame created elsewhere. frame.getContentPane ().add (queryBuilder);Example
Present an SQLQueryBuilderPane and a button. When the button is clicked, present the results of the query in an SQLResultSetFormPane in another frame.
Figure 1 shows the SQLQueryBuilderPane graphical user interface component:
Figure 1: SQLQueryBuilderPane GUI component