Choosing An Access Method
Many factors affect development strategy choices. Availability of tools on different platforms, the developer's familiarity with a given programming environment, and portability requirements often play decisive roles in the process. On the other hand, when the developer has more flexibility, various subtle factors should be considered.
Performance is always a consideration. Run-time performance, however, must be balanced against development time: is it more important to deliver the program quickly, or to have it run quickly in use?
In the context of database programming, the database interface affects both development time and run-time performance. Often the choice between SQL and Btrieve is based on these factors alone.
If you are new to Pervasive PSQL products, you may want to use access methods such as ADO.NET/OLE DB, ActiveX controls, JDBC, Pervasive Direct Access Components for Delphi and C++ Builder, or other third-party development tools to develop Pervasive PSQL applications.
If you want to directly write to the Btrieve API, refer to
Btrieve API Programming
. This chapter provides tips and code samples in several programming languages.
Table
1
compares the various Pervasive PSQL access methods:
Table 1
A Comparison of Application Programming Access Methods
Access Method
Characteristics
Suitable For
Btrieve API
•
DLL can be called by (almost) any Windows programming language.
•
Exposes the complete feature set of the database.
•
Minimum size.
•
Greatest flexibility.
•
Shortest code path between application and data.
•
Least code overhead in the relational database management system (but more application code must be devoted to database management issues).
•
Client/Server capability.
•
BLOB support.
•
Applications where size or run-time performance is the primary consideration.
Java
•
Thin client.
•
Cross-platform portability.
•
Internet/Intranet capability.
•
Supports Winsock and JNI protocols.
•
Machine and OS independence. Internet and Web capability.
•
Minimum size.
•
Good flexibility.
•
Rowset, field abstractions implemented in the interface.
•
Fair overall performance (Java is an interpreted language which carries a heavy code overhead).
•
Client-server features, version control inherent in the language
•
Web applets.
•
Internet-based applications.
•
Applications which must run on various hardware and OS platforms.
ADO/OLE DB
•
Good integration with Visual Studio
•
Can work in either a transactional or relational context
•
Internet/Intranet capability
•
Rowset, field abstractions
•
Applications development using Visual Studio.
ADO.NET
•
Good overall performance.
•
Internet capability.
•
XML Support
•
Efficient scalable architecture
•
Applications running in a managed environment where runtime is paramount.
ActiveX
•
Visual Basic native interface.
•
Supported in most Windows programming environments.
•
Good flexibility.
•
Good overall performance.
•
Internet capability.
•
Rowset, field abstractions.
•
Extended operations, table join features.
•
Client-server features.
•
Applications where a balance of runtime performance and ease of coding is important.
•
Applications that do not require the minimum download footprint or the machine independence of Java, but may require Internet access to data.
SQL/ODBC
•
Abstracts the application interface from the database implementation.
•
Most programming languages, many applications support it.
•
Relational access only.
•
Large. Generally slower than direct interface to the native DBMS API. Provides a “generic” interface to an application.
•
Full relational implementation.
•
Subset of native functionality.
•
Standard interface supported by nearly all Windows programming environments and many off-the-shelf applications.
•
Applications that require heterogeneous access to different data stores, or which must be independent of any particular data store, should consider ODBC.
•
Applications where maintaining a relational data store is the primary consideration, but run-time performance is still important.
Pervasive Direct Access Components
•
Replaces Embarcadero Database Engine in Delphi and C++ Builder
•
Classes to access data from either a transactional or relational context.
•
Application development using Embarcadero IDEs.