You can use DBTools.h++ for virtually any programming task involving interaction with a relational database management system (RDBMS). Its object-oriented architecture results in code that is shorter, cleaner, and more maintainable than code written to specific databases. Its two-tier design supports portability among databases and operating systems, yet allows direct calls to the underlying API.
The unique design of DBTools.h++ supports comprehensive functionality, consistency across multiple databases, and numerous performance enhancements.
DBTools.h++ encapsulates the basic abstractions you need for database programming, as well as the special features required by individual applications. Some of these features include:
Support for internationalization. You can use DBTools.h++ with virtually all known character sets and locales. DBTools.h++ provides proper formatting of strings, dates, times, numbers, and currency. See Chapter 11.
Options for database connections. Class RWDBConnection encapsulates connections to databases. You can let DBTools.h++ manage connections invisibly, or control these resources yourself. Specifying an optimum number of default connections can significantly boost the performance of an application. See Section 4.3 and the entry for RWDBDatabase in the Class Reference for details on defaultConnections() and totalConnections().
Class RWDBEnvironmentHandle lets you set certain connect time and configuration parameters before connecting to a database. See your access library guide.
You can also initiate a connection when an RWDBDatabase is produced by the RWDBManager. See RWDBDatabase::connect() in the Class Reference.
Open SQL. You can control SQL statements directly using this alternative DBTools.h++ interface that encapsulates the semantics for statement execution, parameter binding, and results fetching. See Part IV.
Primary and foreign key support. You can get direct access to schema information, including datatype, precision, scale, and storage length, and primary and foreign key information. The direct mechanism for the creation of tables also supports primary and foreign keys. See the Class Reference entry for RWDBForeignKey, and the description of primaryKey() under RWDBSchema and RWDBTable.
Outer joins. You can construct SQL outer join syntaxes for both SQL 92 standards and non-standard syntaxes supported by some database vendor APIs. See the Class Reference entry for class RWDBJoinExpr and related global functions.
Full exception safety. DBTools.h++ is exception-safe even in environments where C callback routines are used. See Section 5.4.1.
Transaction processing model. DBTools.h++ supplies a uniform, ANSI-compliant interface for all supported databases. See Section 4.3.5.
If you currently work with several different databases, you will find that DBTools.h++ promotes consistency through its processes and procedures. Features that promote consistency include:
Automatic normalization of datatypes. You don't have to adapt to the different ways database vendors represent data; DBTools.h++ does it for you. Class RWDBValue converts database-dependent types to C++ types, and vice-versa. See Chapter 6.
A uniform method for processing results. Some RDBMSs can produce multiple result sets from a single query, or completely unexpected result sets if stored procedures or triggers are involved. Class RWDBResult allows your application to handle these events easily, or to ignore them. No more flushing your data stream. See Section 4.7.4.
A uniform view of tabular data. With class RWDBTable, you can use the same interface to deal with tables in a relational database, tables in program memory, and tables that result from a join. See Section 4.4.
Consistent error handling. Whatever databases you are using, the same error model applies. And DBTools.h++ is exception safe in environments using C callback routines. See Section 5.4.1.
Support for stored procedures. Class RWDBStoredProc encapsulates the functionality of a database stored procedure, including creation, deletion, and execution of stored procedures, and passing parameters by value or by reference. It can handle multiple result sets. See Section 4.10.
Our goal for DBTools.h++ is to bring performance as close as possible to native API performance benchmarks. Product features that specifically enhance DBTools.h++ performance include:
Optimized database access. To save overhead, DBTools.h++ accesses the database only when necessary or when specifically requested. See Section 4.4.1.
Bulk reads and writes. Your DBTools.h++ applications can read arrays of values at once, rather than simply scalar values one at a time. If your underlying database supports this feature, processing data is dramatically faster. See Chapter 7.
Caching. You can significantly enhance performance by explicitly setting cache size in RWDBReader and RWDBInserter. See their respective entries in the Class Reference, and Chapter 8 of the User's Guide.
Asynchronous processing. Your DBTools.h++ applications can continue processing while waiting for I/O, if this feature is also supported by your database vendor API. See Chapter 10.
Dynamic SQL. You can enhance transaction-level performance by binding variables to SQL statements using the class RWDBBoundExpr. This eliminates costly rebinding and reparsing from recurring executions, and enhances the performance of inserting, deleting, and updating. See RWDBBoundExpr in the Class Reference.
Multithreading. Applications that share DBTools.h++ objects across threads can use the internal mutex of objects to control database access with member functions acquire() and release(). A technique involving a user-supplied guard class ensures that acquire() and release()are called in pairs. See Section 9.6.
The DBTools.h++ library is multithread-safe.
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.