Retrieving data from a data source

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

This chapter focuses on using JBuilder's DataExpress architecture to retrieve data from a data source, and provide data to an application. The components in the DataExpress packages encapsulate both the connection between the application and its source of the data, as well as the behavior needed to manipulate the data.

To create a database application, you retrieve information stored in the data source, and create a copy that your application can manipulate locally. The data retrieved from the provider is cached inside a DataSet. All changes to the cached DataSet are tracked so that resolver implementations know what needs to be inserted, updated, or deleted back to the data source. In JBuilder, a subset of data is extracted from the data source into a JBuilder StorageDataSet subclass. The StorageDataSet subclass you use depends on the way in which you obtain the information.

Using a provider/resolver approach, you only need two interactions between the database application and the data source: the initial connection to retrieve the data, and the final connection to resolve the changes back to the data source. The connection between the DataSet component client and the data source can be disconnected after data is provided, and only needs to be re-established for the duration of the resolving transaction.

DataExpress components also provide support for direct data binding to dbSwing components. You simply set a property in the Inspector to bind Data to visual components.

Some of the tutorials in this chapter use a JDataStore driver to access data in a JDataStore. Others use a JDBC driver to access data in InterBase tables. Both of these options have their advantages. Which you choose depends on your application needs. With both options,


When to use JDataStore vs. JDBC drivers

You may wish to use a JDataStore to:

You may wish to use a JDBC driver to:


Overview of the DataExpress components

This chapter discusses retrieving data using the DataExpress components listed below. There are tutorials showing the steps necessary to use these components to create database applications. The samples are located in JBuilder/samples/DataExpress/. If you experience problems running the sample applications, see "JBuilder sample files" for information critical to this process.

For QueryDataSet and ProcedureDataSet components, the data source is often a SQL server database. In this case, you also need a Database component to handle the connection to the server. See "Connecting to a database" for more information on connecting to a server. When using the TableDataSet and TextDataFile components, you are usually reading data from a text file. Because you are not accessing SQL server data, you do not need a Database component.

See also:
Understanding JBuilder's DataExpress architecture
DataExpress Component Library Reference
Exploring database tables and metadata using the JDBC Explorer
Using data modules to simplify data access


   Connecting to a database An introductory database tutorial using a text file