The Zen Software Development Kit (SDK) offers you the best of both worlds for database solutions: the MicroKernel Engine offers high speed data transactions, and the Relational Engine provides full featured relational data access to the same data with greater performance in reporting and decision support.
This chapter provides quick tips to help you begin building applications with Zen, which are described in the following sections:
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 Zen products, you may want to use access methods such as ADO.NET/OLE DB, ActiveX controls, JDBC, Zen Direct Access Components for Delphi and C++ Builder, or other third-party development tools to develop Zen applications.
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.
Zen 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.
Database Connection Quick Reference
This section provides links to quick information on how to get connected to a Zen database.
These examples should only supplement the full documentation for each access method. For each access method, there are links to more detailed information.
Each sample references the Course table in the DEMODATA sample database, which is included with Zen.
Zen allows an application to perform a DSN-less connection (connecting to the SQL engine without using a DSN):
The following steps should be used when running locally on the server or from a remote client. This method works with Enterprise Server as well as Workgroup engines.
1 SQLAllocEnv
2 SQLAllocConnect
3 SQLDriverConnect: "Driver={Pervasive ODBC Client Interface};ServerName=<ServerName to Resolve>;dbq=@<ServerSide DBName>;"
Note Releases earlier than Pervasive.SQL 2000 (SP3) supported DSN-less connections only for applications running local to the engine (i.e. running on the same machine where the engines were running). However, the format of the Driver string changed starting with Pervasive.SQL 2000i (SP3). Any applications using DSN-less connections will have to be modified as shown above, and recompiled in order to run without a DSN under Pervasive.SQL 2000 (SP2a) or earlier.
ODBC Information
The implementation and limitations of the Zen ODBC access method is documented in the ODBC Guide. This documentation is shipped with Zen Enterprise Server, Cloud Server, Workgroup, and Client editions.
Zen Direct Access Components are for Delphi and C++ Builder applications. For more information, see the following topics in Zen Direct Access Components Guide.
The following topics provide further reading on Zen concepts.
Conceptual Information
This manual contains database conceptual information on both the MicroKernel Engine and Relational Engine.
Reference Information
Reference information for developers is contained in the various software development kit (SDK) manuals. In the Eclipse Help that can be installed with the database engine, see the topic Developer Reference.
Online Developer Resources
Get information for developers online at the Actian Zen website.
Sample Code
You can find the sample applications in your installation of the SDK component. The available samples include the following:
•ADO/OLE DB Programming using Visual Basic or Visual C++
•Zen Direct Access Components using Delphi or C++ Builder
•Java Programming with the Zen Java Class Library or JDBC
•Distributed Tuning Interface for Visual C++ or Delphi