Database application development is a feature of JBuilder Professional and Enterprise. Distributed application development is a feature of JBuilder Enterprise.
In the UI designer, data appears in the JdbTable
and the application looks complete. But users will not be running your application in the JBuilder UI designer. So, the next step is to compile, run, test, and possibly debug the application.
To compile and run the application, click the Run Project button.
Clicking the Run button compiles your source code (if it has not already been compiled). If no errors are found, a message indicating that the source code has successfully compiled displays in the message box at the bottom of the AppBrowser. The application UI displays in a new, separate window.
If there are syntax errors in the source code, the program is not automatically run. If syntax errors are found, the error messages appear in the message pane at the bottom of the AppBrowser. Double-click on the error message to locate the source of the error in the code. Errors in programming logic may not appear until run time when the application performs in unexpected ways.
You will probably not encounter any syntax errors in this simple application because all properties were selected from drop-down lists or browsers. Syntax errors are most likely to occur when you modify the generated code, or when you add in Java code manually.
If you would like more information on compiling and debugging applications in JBuilder, see the online help topics "Compiling Java programs" and "Debugging Java programs".
You'll notice the following behavior in the running application:
JdbTable
displays the data from the text file.
JdbStatusLabel
along the bottom of your application displays the number of rows in the table, and your current row position. The JdbStatusLabel
displays messages generated by the TableDataSet
. For example, when you change data in the table, the status label displays "Editing row". As you move through the rows, you'll notice the JdbStatusLabel
updates automatically.
JdbNavToolBar
buttons at the top of your application enable you to move through the data, edit the data, or insert or delete rows. This occurs because the table and the toolbar are bound 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.
Although the JdbNavToolBar
has a Save button, this button is dimmed, and you cannot save changes to file-based data sources such as employee.txt. If this application had connected to a true database, the Save button provides a default mechanism for saving changes back to a data source. For more information on saving changes to a database, see "Saving changes back to your data source." For more information on saving changes when the data source is a text file, see "Exporting data."
Alternatively, the keyboard can be used to navigate the data in the table.
JdbTable
for viewing and editing, displays status messages to a JdbStatusLabel
, and includes a JdbNavToolBar
component to help browse though the data.
This tutorial was intended to familiarize you with the JBuilder environment and the basic requirements for developing a database application with JBuilder. Other topics in this chapter address retrieving data from various data sources using SQL queries and stored procedures. The "Importing and exporting data" chapter provides more information on retrieving data from text files. The "Filtering, sorting, and locating data" chapter shows how to include additional database functions in your application.
Retrieving data from a data source
Querying a database
Using parameterized queries to obtain data from your database
Obtaining data using a stored procedure
Importing and exporting data
Filtering, sorting, and locating data
![]() |
Querying a database![]() |