Ensuring data persistence

Database application development is a feature of JBuilder Professional and Enterprise. Distributed application development is a feature of JBuilder Enterprise.

Between the time that you develop an application and each time the user runs it, many changes can happen to the data at its source. Typically, the data within the data source is updated. But more importantly, structural changes can happen and these types of changes cause greater risk for your application to fail. When such condition occurs, you can

By default, the columns that display in a data-aware component are determined at run-time based on the Columns that appear in the DataSet. If the data structure at the data source has been updated and is incompatible with your application, a run-time error is generated when the situation is encountered.

JBuilder offers support for data persistence as an alternative handling of such situations. Use this feature if your application depends on particular columns of data being available in order for your application to run properly. This assures that the column will be there and the data displayed in the specified order. If the source column of the persistent Column changes or is deleted, an Exception is generated instead of a run-time error when access to the column's data fails.

Making columns persistent

You can make a column persistent by setting any property at the Column level (for example, an edit mask). When a column has become persistent, square brackets ([ ]) are placed around the column name.

To set a Column level property,

  1. Open any project that includes a DataSet object, for example, select any project file (.jpr) in the /samples/DataExpress/ subdirectory of your JBuilder installation.

  2. Double-click the Frame file to open it into the content pane, then click the Design tab.

  3. Double-click the DataSet object. This displays the Column designer for the data set. The Column designer looks like this for the employee sample table:

  4. Select the Column for which you want to set the property. The Inspector updates to reflect the properties (and events) of the selected column.

  5. Set any property by entering a value in its value box in the Inspector. If you don't want to change any column properties, you can set a value, then reset the value to its default.

To demonstrate, set the a minimum value for a Column containing numeric data by entering a numeric value in the min property. JBuilder automatically places square brackets ([ ]) around the column name.

In the Column designer, the columns for that data set are displayed in a table in the UI designer. A toolbar for adding, deleting, navigating, and restructuring the data set is provided.

To close the Column designer, double-click any UI component, such as contentPane, in the content pane, or click a different component, and select Activate Designer.The only way to close one designer is to open a different one.