Database application development is a feature of JBuilder Professional and Enterprise. Distributed application development is a feature of JBuilder Enterprise.
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:
DataSet
functionality
This is a collection of data handling functionality available to applications using DataExpress
. Much of this
functionality can be applied using declarative property and event settings. Functionality includes navigation, data access/update,
ordering/filtering of data, master-detail support, lookups, constraints, defaults, etc.
Data source independence
The retrieval and update of data from a data source, such as an Oracle or Sybase server, is isolated to two key
interfaces: Provider
/Resolver
. By cleanly isolating the retrieval and
updating of data, it is easy to create new
Provider
/Resolver
components for new data sources. There are two
Provider
/Resolver
implementations for standard JDBC drivers that provide
access to databases such as Oracle, Sybase,
Informix, InterBase, DB2, MS SQL Server, Paradox, dBase, FoxPro, Access,
and other databases. You can also create custom Provider
/Resolver
component implementations for EJB,
application servers, SAP, BAAN, IMS, CICS, etc.
When data is retrieved from a Provider
it is
cached inside the DataSet
. All edits made to the cached DataSet
are
tracked so that Resolver
implementations know what needs to be updated
back to the data source. DataExpress
provides two options for this
caching storage: MemoryStore
(the default), and JDataStore
.
MemoryStore
caches all data and data edits in memory. JDataStore
uses a pure Java,
small footprint, high performance, embeddable database to cache data and
data edits. The JDataStore
is ideally suited for disconnected/mobile
computing, asynchronous data replication, and small footprint database
applications.
Data binding support for visual components
DataExpress
DataSet
components provide an powerful programmatic interface, as well as support
for direct data binding to data-aware components by way of point and click property settings made in a visual
designer. JBuilder ships with Swing-based visual components that
bind directly to DataSet
components.
The benefits of using the modular DataExpress
Architecture include:
As mentioned, the Provider
/Resolver
approach isolates interactions with arbitrary data sources to two clean points. There are two other benefits to this approach:
Provider
/Resolver
can be easily partitioned to a middle tier. Since Provider
/Resolver
logic typically has a transactional nature, it is ideal for partitioning to a middle tier.
DataSet
component client and the data source can be disconnected after
providing. When changes need to be saved back to the data source, the connection need only be re-established for the duration of the resolving transaction.
Rapid development of user interfaces
Since DataSet
s can be bound to data-aware components with a simple property setting, they are ideally suited for rapidly building database application user interfaces.
Mobile computing
With the introduction of the DataStore
component, DataExpress
applications have a persistent, portable database. The DataStore
can contain multiple DataSet
s, arbitrary files, and Java Objects. This allows a complete application state to be persisted in a single file. DataSet
components have built-in data replication technology for saving and reconciling edits made to replicated data back to a data
source.
The small footprint, high performance JDataStore
database is ideal for embedded applications and supports the full functionality and semantics of the DataSet
component.
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 com.borland.dx.dataset
, com.borland.dx.sql.dataset
, and com.borland.datastore
packages. 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 database-related 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 driver, URL, user name, and password.
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 . Because it extends ReadWriteRow , DataSet has methods to get and put field values.
|
The SortDescriptor object contains properties that affect the order in which data is accessed and displayed in a UI component. Set using the sort property. See "Sorting data" for a tutorial.
The |
StorageDataSet |
A class that extends DataSet by providing implementation for storage of the data and manipulation of the structure of the DataSet .
You fill a |
The The The |
DataStore |
The DataStore component provides a replacement for MemoryStore that gives a permanent storage of data. A JDataStore 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 JDataStore file has a hierarchical directory structure
that associates a name and directory status with a particular data
stream. JDataStore can be treated like any SQL database - you can connect to it as you would to any server, run SQL queries against it, etc.
See "Persisting and storing data in a JDataStore" in Database Application Developer's Guide, and the JDataStore User's Guide, for more description of the |
Caching and persisting StorageDataSet s in a DataStore is
accomplished through
two required property settings on a StorageDataSet called
store
and storeName . By default, all StorageDataSets use a
MemoryStore
if the store property is not set. Currently
MemoryStore and
DataStore are the only implementations for the store property. The
storeName property is the unique name associated with
this
StorageDataSet in the DataStore .
|
DataStoreDriver |
DataStoreDriver is the JDBC driver for the JDataStore .
The driver supports both local and remote access. Both types of access
require a user name (any string, with no setup required) and an empty
password.
|
|
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 SQL query statement, query parameters, and database connection information. Accessed using the query property. |
ProcedureDataSet |
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.
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. It mimics 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 of which the DataSetView presents a view. |
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 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 content pane, then selecting the Column that you want to work with. The selected Column component's properties and events display in either the Column designer (properties only) or in the Inspector and can be edited in either place.
|
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. The names of the columns in a DataRow are field names.
A |
|
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 parameter names (which are the ParameterRow column names).
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 com.borland.dx.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 content pane, 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 "Using data modules to simplify data access" for more description and a tutorial using this component. |
There are many other classes and components in the com.borland.dx.dataset
, com.borland.dx.sql.dataset
, and com.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 DataExpress
Library can be found in the DataExpress Library Reference documentation.