Project Notes


Project: TextDataFile tutorial
Description
This sample application contains the completed files from the tutorial entitled An introductory tutorial: TextDataFile in the Database Application Developer's Guide. It explores basic database concepts and JBuilder's DataBroker architecture.

The user-interface of application consists of three controls: a GridControl that displays the data from a text file, and a navigator to aid in browsing through the data, and a status area that displays messages.

This tutorial 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.


When you run your application, you'll notice the following behavior:

  • The GridControl is filled with data from the text file and looks identical to how it is displayed in the UI Designer.

  • The StatusBar along the bottom of your application displays the number of rows in the grid, and your current row position. The StatusBar displays messages generated by the TableDataSet. As you move through the rows, you'll notice the StatusBar updates automatically.

  • You can use the keyboard to navigate the data in the grid.

  • Alternatively, you can click the NavigatorControl buttons to move you through the data in the grid. This occurs because we set the grid and the navigator to the same TableDataSet. When two or more components are both bound to the same DataSet, they are said to "share" a cursor because they automatically synchronize to point to the same row of data.

  • You can make any changes you want to the data, including changing existing information, or deleting and adding new rows.

  • We haven't added any special functionality to update information back to the data source, so you cannot save changes you make to the data back to the employee.txt file.

    Note: Although the NavigatorControl includes a Save button, this button is dimmed for file-based data sources such as employee.txt. If we had connected to a true database in this example, the Save button would be available to save changes made to the data back to its database source. For more information on saving changes to a database, see Basic resolving in the Database Application Developer's Guide. For more information on saving changes to a data file, see Exporting data in the Database Application Developer's Guide.