This sample application contains the completed files referenced in the
topic "Common database application tasks" in the Database
Application Developer's Guide. It explores
a typical database application and ties in individual features that are
explored in various topics in the Database
Application Developer's Guide.
This sample requires that you have a version of JBuilder that
includes the JBuilder DataBroker database architecture components.
Note: All versions of JBuilder provide
direct access to SQL data through the JavaSoft JDBC API.
Some versions of JBuilder provide additional DataBroker
components (on the Data Access tab of the Component Palette)
that greatly simplify RAD visual development of database
applications. Refer to the JBuilder product page from the
Borland Web site for availability
of features in each JBuilder version.
Before you can run this application, install and set up
Local InterBase Server and the sample data source as described in
Installing and setting up in the Database
Application Developer's Guide.
When you run this application, the application window may be too tall to
see the calculated fields and status information displayed near the bottom
of the window. Depending on your monitor's resolution, you may want to resize
the window so that this information is easily visible.
This application demonstrates the following functionality:
- Connects to the InterBase sample table, employee.gdb, using
the Database and QueryDataSet components.
(See "Connecting to a database using JDBC" and
"Querying a database" in the Database Application
Developer's Guide)
- Includes a custom menu that offers the same functionality
as custom buttons on the application UI. The menus
in this application were created using the Menu Designer.
For information on creating menus with the Menu Designer,
see "Designing menus" in the User Guide.
- Contains a GridControl which displays the the
data while also demonstrating the following features:
- Persistent columns, which are columns where structure information
typically obtained from the server is specified as a column
property instead. This offers performance benefits as well
as persistence of column-level properties. (See "Working with
Columns" in the Database Application Developer's
Guide for more information on this feature.)
- Formatting of the data displayed in the GridControl
using display masks. (See "Adding an edit or display pattern
to control data" in the Database Application Developer's Guide.)
- Data editing that is controlled using edit masks. (See
"Adding an edit or display pattern to control data" in the
Database Application Developer's Guide.)
- Calculated fields which get their values as a result of an
expression evaluation. (See "Using calculated columns" in the
Database Application Developer's Guide.)
- Includes a StatusBar control that displays navigation
information, data validation messages, and so on.
Messages are written to the StatusBar control when
appropriate, or when instructed programmatically. (See
"Displaying status information" in the Database Application
Developer's Guide.)
- Displays a NavigatorControl when the application loads.
Use this control to navigate through the data displayed in the grid.
The NavigatorControl appears at the same location as the
LocatorControl. You toggle which control displays by selecting the
corresponding menu option or radio button.
- Allows you to locate data interactively by including the
LocatorControl. (See "Locating data with the LocatorControl" in the
Database Application Developer's Guide.) The LocatorControl
is hidden initially and is displayed by clicking the Find radio button or
selecting the corresponding menu option.
The LocatorControl has an associated TextFieldControl called
"Find" that acts as the label for the LocatorControl. It is displayed
when Find is selected.
Selecting Find causes the following:
- The LocatorControl is set to visible
by toggling its visible property, and the user
types in the value to search for. The
LocatorControl watches for Enter
to signal the end of the search criterion.
- The LocatorControl performs the search and results are
displayed by the StatusBar component.
The LocatorControl disappears (its visible property set
to false) when the Display navigator button is pressed.
- Resolves changes made to the data in the QueryDataSet by
using default resolver behavior. (See "Basic resolving" in the Database
Application Developer's Guide.) The Save button of the NavigatorControl
performs the save. Messages regarding the resolve process are
displayed in the StatusBar control.
Note: Because of data constraints on the employee,
the save operation may not succeed depending on the data you change.
Since other edits may return errors, we suggest you make changes
only to the FIRST_NAME and LAST_NAME values in existing rows until
you become more familiar with the constraints on this table. For
more information, see
Installing Local InterBase Server and
Tips on using InterBase
in the Database Application Developer's Guide.