Description
The Mimer dbExpress Driver can be used to develop dbExpress based applications with Mimer SQL.
Borland® dbExpress is a database independent database access interface. It is used in Borland developer products such as Delphi and C++Builder. dbExpress is designed to meet the following six goals.
- Minimize size and system resource use
- Maximize speed
- Provide cross-platform support
- Provide easier deployment
- Make driver development easier
- Give the developer more control over memory usage and network traffic
The Mimer dbExpress Driver is implemented as a single DLL on the Windows® platform. It gives you a full-featured, high performance, high concurrency system for working with data in SQL databases.
The dbExpress provide/resolve architecture uses four components for managing the data editing and update process.
The first is the SQLConnection component that provides a connection to the dbExpress driver for the database you are using.
Next is a dbExpress dataset component that provides data by executing a SQL SELECT statement or calling a stored procedure.
The third component is the DataSetProvider, and the fourth is the ClientDataSet.
When you open the ClientDataSet, it requests data from the DataSetProvider. The DataSetProvider opens the query (or stored procedure) component, retrieves the records, closes the query component, and supplies the records, with any required metadata, to the ClientDataSet. The ClientDataSet holds the records in memory while they are viewed and modified. As records are added, deleted, or updated, either in code or via the user interface, the ClientDataSet logs all changes in memory.
To update the database, you call the ClientDataSet ApplyUpdates method. ApplyUpdates transmits the change log to the DataSetProvider. The provider starts a transaction, then creates and executes SQL statements to apply the changes to the database. If all changes are applied successfully, the provider commits the transaction. In case of failure, it rolls the transaction back and the ClientDataSet error is handled.
Benefits of the dbExpress architecture
Short transaction life With the dbExpress architecture, transactions exist for a moment when updates are applied. This dramatically reduces resource consumption and improves concurrency on a busy database server.
Make any rows editable Rows returned by multi-table joins, stored procedures, or read-only views cannot be edited directly. By using the ProviderFlags property of the field objects to identify the fields that should be updated and the DataSetProvider OnGetTableName event to supply the name of the table, many read only datasets can be edited easily.
Instantaneous sorting and searching Since the ClientDataSet holds records in memory, they can be sorted quickly. If an in-memory sort is too slow, you can create indexes on the ClientDataSet data at design time or runtime. These in-memory indexes let you change the viewing order of records or locate records virtually instantaneously without the overhead of maintaining indexes in the database.
Automatic summary information ClientDataSets will automatically maintain complex summary calculations you define. You can group summary calculations by any field or combination of fields to provide group totals. You can also use the Min, Max, Count and Avg (average) aggregates.
View subsets of data Filter expressions using SQL WHERE syntax let you easily display a subset of the records in a ClientDataSet without the overhead of executing another query on the database server.
Multiple simultaneous views of data The ability to clone a ClientDataSet cursor lets you view different subsets of the data in a ClientDataSet simultaneously. You can also view the same data sorted differently.
Calculated fields with no server overhead You can add calculated fields to a ClientDataSet at design time to make computed fields part of the in-memory dataset. Since the calculations are performed using compiled Borland Delphi™ or C++ language code, they are faster and can be far more complex than computed columns in a SQL statement or the calculations possible in stored procedures, yet they impose no storage or computational burden on the database server.
The limitation that isn’t there Holding records in memory may seem like a limitation on the number of records you can work with. However, consider that traditional client/server application design has always been to select small sets of records to minimize network traffic and database server load. Even if you need to work with an unusually large number of records, remember that 10,000 records containing 100 bytes each requires only one megabyte of memory. In the unlikely event that you need to work with a very large number of records, the ClientDataSet and DataSetProvider include properties and events that let you fetch a portion of the records, edit them, remove them from memory, and then fetch the next group of records.
Easier deployment An application using dbExpress requires just two DLLs to function. The first is the dbExpress driver, for example DBEXPMIM.DLL in the case of the Mimer dbExpress Driver and the second is MIDAS.DLL, the ClientDataSet support library. Together, these two DLLs are less than half a megabyte in size. This minimizes application size and simplifies installation. If you prefer not to distribute these DLLs, you can compile them directly into your EXE.
Deploying the Mimer dbExpress Driver
The Mimer dbExpress Driver can be installed as a part of the application. The easiest way to include the driver in the application installation is to copy the dbexpmim.dll file into the application installation bundle.
License
The Mimer dbExpress Driver is distributed for free under the terms of the GNU Lesser General Public License.
|