Database application development is a feature of JBuilder Professional and Enterprise. Distributed application development is a feature of JBuilder Enterprise.
A database application is any application that accesses stored data and allows you to view and perhaps modify or manipulate that data. In most cases, the data is stored in a database. However, data can also be stored in files as text, or in some other format. JBuilder allows you to access this information and manipulate it using properties, methods, and events defined in the DataSet
packages of the DataExpress
Component Library in conjunction with the dbSwing
package.
A database application that requests information from a data source such as a database is known as a client application. A DBMS (Database Management System) that handles data requests from various clients is known as a database server.
"JBuilder's DataExpress architecture" is focused on building all-Java client-server applications, applets, servlets, and JavaServer Pages (JSP) for the inter- or intranet. Because applications you build in JBuilder are all-Java at run time, they are cross-platform.
JBuilder applications communicate with database servers through the JDBC API, the Sun database connectivity specification. JDBC is the all-Java industry standard API for accessing and manipulating database data. JBuilder database applications can connect to any database that has a JDBC driver.
The following diagram illustrates a typical database application and the layers from the client JBuilder DataExpress
database application to the data source:
The major components in a database application are:
DataSet
DataSet
is an abstract class. A large amount of the public
API for all DataSet
s is surfaced in this class. All navigation, data access, and update APIs for a DataSet
are surfaced in this class. Support for master-detail relationships, row ordering, and row filtering are surfaced in this class. Some of the dbSwing
data-aware components have a dataSet
property. This means that a JdbTable
, for example, can have its dataSet
property set to the various extensions of
DataSet
: DataSetView
, QueryDataSet
, ProcedureDataSet
, and TableDataSet
.
StorageDataSet
StorageDataSet
can use in-memory storage (MemoryStore
) to cache its data. The StorageDataSet
store
property can also be set to a DataStore
component to provide persistence for the DataSet
data. The StorageDataSet
manages the
storage of DataSet
data, indexes used to maintain varying views
of the data, and persistent Column
state.
All structural APIs (add/delete/change/move column) are surfaced
in this class. Since StorageDataSet
s manage the data, it is where
all row updates, inserts, and deletes are automatically recorded.
Since all changes to the StorageDataSet
are tracked, we know
exactly what needs to be done to save (resolve) these changes
back to the data source during a resolution operation.
JDataStore
The DataStore
component provides high performance data caching and
compact persistence for DataExpress DataSet
s, 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.
DataSetView
This component can be used to provide independent
navigation (a cursor) with row ordering and filtering different
than that used by the base DataSet
. To use this component, set the storageDataSet
property of the DataSetView
component.
Use this component when multiple components need to dynamically switch
to a new DataSet
. The components can all be wired to the same DataSetView
.
To force them all to view a new DataSet
, the DataSetView storageDataSet
property can be changed.
QueryDataSet
This is a JDBC specific DataSet
. It manages a JDBC
provider of data. The data to be provided is specified in a query
property. The query
property specifies a SQL statement.
ProcedureDataSet
This is a JDBC specific DataSet
. It manages a JDBC
provider of data. The data to be provided is provided with a
procedure
property. The procedure
property specifies a stored procedure.
TableDataSet
This is a generic DataSet
component without a built-in provider mechanism. Even though it has no default provider,
it can be used to resolve its changes back to a data source.
Column
and data can be added to a TableDataSet
through DataSet
methods or by importing data with a DataFile
component (like TextDataFile
).
The Row
classes are used extensively in the DataExpress
APIs. The ReadRow
and ReadWriteRow
are used much like interfaces that indicate the usage intent. By using a class hierarchy, implementation is shared, and there is a slight performance advantage over using interfaces.
The class hierarchy associated with the DataSet
methods is as follows:
java.lang.Object +----com.borland.dx.dataset.ReadRow +----com.borland.dx.dataset.ReadWriteRow +----com.borland.dx.dataset.DataSet +----com.borland.dx.dataset.StorageDataSet +----com.borland.dx.sql.dataset.QueryDataSet
StorageDataSet
methods deal with data set structure
DataSet
methods handle navigation
ReadWriteRow
methods let you edit columns in the current row
ReadRow
methods give read access to columns in the current row
TableDataSet
and QueryDataSet
inherit all these methods.
The next section, entitled "Understanding JBuilder's DataExpress
architecture", discusses the components of the DataExpress
architecture in more detail.