Setting properties in the query dialog

The query property editor displays when you choose the query property of a QueryDataSet. This editor can be used to set the properties of the QueryDescriptor visually, but it also has several other uses. The dialog is displayed below. Each of the dialog options is explained in further detail as well.

The Query page

On the Query tab, the following options are available:

The Parameters page

On the Parameters tab, you can select an optional ReadWriteRow or DataSet from which to fill in parameters, used for parameterized queries. Parameter values are specified through an instantiated ReadWriteRow object (or an instance of any of its subclasses), for example, a DataSet object. Select the ReadWriteRow object (or the ReadWriteRow subclass) that contains the values for your query parameters from the drop-down list. See Parameterizing a query for an example of this.


SQL Builder

The visual SQL Builder is a tool for helping you write an appropriate SQL statement. In order to use the SQL Builder, the Database component must be connected to a local Borland DataGateway alias. It is perfectly acceptable for that database and its tables to reside on another machine, but the alias describing that connection must reside on the client machine. See the Borland Database Engine (BDE) Administrator tool to create new aliases on the client machine.

The SQL Builder is displayed by clicking the SQL Builder button in the query property dialog of a QueryDataSet component. This button is dimmed and unavailable while the Database field displays the value <none>, or when the database that is selected is not a DataGateway database with a local alias.

If a request is made to use the SQL Builder against a DataGateway remote table, JBuilder will attempt to open an alias of the same name on the client machine. Since this step is needed only to acquire the necessary low level metadata for the graphical SQL Builder, the SQL code generated will still run against the remote DataGateway database when the query is actually executed. It is only during design, and only within the SQL Builder tool, that this remote-to-local mapping occurs.

Therefore, if you anticipate using the SQL Builder against remote Borland DataGateway tables when designing JBuilder applications, it is a good idea to maintain BDE aliases (using the BDE Administrator tool) on the client machine which are exact duplicates of those residing on the respective remote machine(s). This will allow you to design locally, but deploy against the actual remote tables without changing your Java code.

SQL Builder enables you to visually and interactively create and execute SQL queries. An expert knowledge of SQL isn't necessary to create complex SQL queries. SQL Builder can even be a tool for learning SQL. When you use SQL Builder, you can view and edit the resulting SQL. You can create a full range of SQL queries, from the simplest SELECT to a complicated multi-table join with calculated fields and expression based joins. The SQL Builder user interface is composed of the following elements:

These are the tasks you can perform with SQL Builder:

For more information on the SQL Builder, see its online help.


Place SQL text in resource bundle

A java.util.ResourceBundle contains locale-specific objects. When your program needs a locale-specific resource, your program can load it from the resource bundle that is appropriate for the current user's locale. In this way, you can write program code that is largely independent of the user's locale isolating most, if not all, of the locale-specific information in resource bundles.

The Create ResourceBundle dialog appears when the query editor is closing, if a SQL statement has been defined in the query editor and the "Place SQL text in resource bundle" option has been checked. The resource bundle dialog looks like this:

To use a resource bundle in your application,

For more information on resource bundles, see the JavaDoc for java.util.ResourceBundle, found from JBuilder help by selecting Help|Java Reference. Then select the java.util package, and the ResourceBundle class.