DataExpress components were designed to be modular to allow the separation of key functionality. This design allows the DataExpress components to handle a broad variety of applications. Modular aspects of the DataExpress architecture include:
The benefits of using the modular DataExpress Architecture include:
For more information on the DataExpress architecture, visit the Borland Web site at http://www.borland.com/jbuilder/ for a white paper on this topic.
The core functionality required for data connectivity is contained in the borland.jbcl.dataset, borland.sql.dataset, and borland.datastore packages of the JBCL. The components in these packages encapsulate both the connection between the application and its source of the data, as well as the behavior needed to manipulate the data. The features provided by these packages include that of database connectivity as well as data set functionality.
The main classes and components in the borland.jbcl.dataset, borland.sql.dataset, and borland.datastore packages are listed in the table below, along with a brief description of the component or class. The right-most column of this table lists frequently used properties of the class or component. Some properties are themselves objects that group multiple properties. These complex property objects end with the word Descriptor and contain key properties that (typically) must be set for the component to be usable.
Component/Class | Description | Frequently used properties |
Database |
A required component when accessing data stored on a remote server, the Database component manages the JDBC connection to the SQL server database. See Connecting to a database for more description and a tutorial using this component. |
The ConnectionDescriptor object stores connection properties of user name, password, and connection URL. Accessed using the connection property. |
DataSet | An abstract class that provides basic data set behavior, DataSet also provides the infrastructure for data storage by maintaining a two-dimensional array that is organized by rows and columns. It has the concept of a current row position, which allows you to navigate through the rows of data and manages a "pseudo record" that holds the current new or edited record until it is posted into the DataSet. |
The SortDescriptor object contains properties that affect the order in which data is accessed and displayed in a UI control. Set using the sort property.
The MasterLinkDescriptor object contains properties for managing master-detail relationships between two DataSet components. Accessed using the masterLink property on the detail DataSet. |
StorageDataSet |
An abstract class that extends the DataSet class by providing implementation for storage of the data and manipulation of the structure of the DataSet.
You fill a StorageDataSet component with data by extracting information from a remote database (such as InterBase or Oracle), or by importing data stored in a text file. This is done by instantiating one of its subclasses: QueryDataSet, ProcedureDataSet (for stored procedures, available in the Client/Server version only), or TableDataSet. |
The tableName property specifies the data source of the StorageDataSet component. The maxRows property defines the maximum number of rows that the DataSet can initially contain. The readOnly property controls write-access to the data. |
DataStore |
The DataStore component provides high performance data caching and
compact persistence for DataExpress DataSets, arbitrary files, and Java
Objects. The DataStore component uses a single file to store one or more
data streams. A DataStore file has a hierarchical directory structure
that associates a name and directory status with a particular data
stream. See Storing data locally with DataStore for more description of the DataStore component. |
Caching and persisting StorageDataSets in a DataStore is accomplished through two required property settings on a StorageDataSet called StorageDataSet.store and StorageDataSet.storeName. By default, all StorageDataSets use a MemoryStore if the StorageDataSet.store property is not set. Currently MemoryStore and DataStore are the only implementations for the store property. The StorageDataSet.storeName property is the unique name associated with this StorageDataSet in the DataStore directory.. |
QueryDataSet |
The QueryDataSet component stores the results of a query string executed against a server database. This component works with the Database component to connect to SQL server databases, and runs the specified query with parameters (if any). Once the resulting data is stored in the QueryDataSet component, you can manipulate the data using the DataSet API.
See Querying a database for more description and a tutorial using this component. |
The QueryDescriptor object contains the query statement, query parameters, and database component. Accessed using the query property. |
ProcedureDataSet |
Available only in the Client/Server edition, the ProcedureDataSet component holds the results of a stored procedure executed against a server database. This component works with the Database component in a manner similar to the QueryDataSet component. ProcedureDataSet components are only available in the Client/Server version of JBuilder.
See Obtaining data through a stored procedure for more description and a tutorial using this component. |
The ProcedureDescriptor object contains the SQL statement, parameters, database component, and other properties. Accessed using the procedure property of the ProcedureDataSet component. |
TableDataSet |
Use this component when importing data from a text file. This component extends the DataSet class by adding behavior that allows it to mimic SQL server functionality, without requiring a SQL server connection.
See Importing data from a text file for more description and a tutorial using this component. |
The (inherited) dataFile property specifies the file name from which to load data into the DataSet and to save the data to. |
DataSetView |
This component presents an alternate "view" of the data in an existing StorageDataSet. It has its own (inherited) sort property, which, if given a new value, allows a different ordered presentation of the data. It also has filtering and navigation capabilities that are independent of its associated StorageDataSet.
See Presenting an alternate view of data for more description and a tutorial using this component. |
The storageDataSet property indicates the component which contains the data that the DataSetView presents a view of. |
Column |
A Column represents the collection from all rows of a particular item of data, for example, all the Name values in a table. A Column gets its value when a DataSet is instantiated or as the result of a calculation.
The Column is managed by its StorageDataSet component. See Working with columns for more description and a tutorial using this component. |
You can conveniently set properties at the Column level so that settings which affect the entire column of data can be set at one place, for example, font. JBuilder design tools include access to column-level properties by double-clicking any StorageDataSet in the Component Tree, then selecting the Column that you want to work with. The selected Column component's properties and events display in the Inspector and can be edited there. |
DataRow |
The DataRow component is a collection of all Column data for a single row where each row is a complete record of information. The DataRow component uses the same columns of the DataSet it was constructed with.
A DataRow is convenient to work with when comparing the data in two rows or when locating data in a DataSet. It can be used in all DataSet methods that require a ReadRow or ReadWriteRow. |
|
ParameterRow |
The ParameterRow component has a Column for each column of the associated data set that you may want to query. Place values you want the query to use in the ParameterRow and associate them with the query by their ParameterRow column names. Although scoped DataRows can be used for parameter settings, the Column components in the DataRow map directly to the column and therefore do not allow more than one reference in a DataRow.
See Using parameterized queries to obtain data from your database for more description and a tutorial using this component. |
|
DataModule |
The DataModule is an interface in the borland.jbcl.dataset package. A class that implements DataModule will be recognized by the JBuilder designer as a class that contains various dataset components grouped into a data model. You create a new, empty data module by selecting the Data Module icon from the File|New dialog. Then using the Component Palette and Component Tree, you place into it various DataSet objects, and provide connections, queries, sorts, and custom business rules logic. Data modules simplify reuse and multiple use of collections of DataSet components. For example, one or more UI classes in your application can use a shared instance of your custom DataModule.
See Separating database access logic and business rules from the user interface for more description and a tutorial using this component. |
There are several other classes and components in the borland.jbcl.dataset, borland.sql.dataset, and borland.datastore packages as well as several support classes in other packages such as the util and view packages. Detailed information on the packages and classes of the JavaBeans Component Library (JBCL) is included in the JBCL Reference documentation.