FairCom is pleased to present the c-tree database API: CTDB. This API gives application developers a simple interface into the powerful core of c-tree, yet includes the advanced functionality that distinguishes c-tree from other database solutions. CTDB offers a method of database creation and maintenance that is easier to use than the traditional c-tree ISAM and low-level APIs. The c-tree database utilizes the simplified concepts of sessions, databases, and tables in addition to the standard concepts of records, fields, indexes, and segments. This new database API allows for effortless and productive management of database systems.
The FairCom DB API C++ API provides libraries that, once installed and correctly referenced, allow C++ programs to access the c-tree database core via function calls. This approach provides application developers with a simple interface into the powerful core of c-tree, yet includes the advanced functionality that distinguishes c-tree from other database solutions. FairCom DB API offers a method of database creation and maintenance that is easier to use than the traditional FairCom DB ISAM and FairCom Low-Level APIs.

FairCom DB API utilizes the simplified concepts of sessions, databases, and tables in addition to the standard concepts of records, fields, indices, and segments. This database layer allows for effortless and productive management of database systems.

FairCom DB API consists of two separate APIs. The C++ API provides the classes and methods that comprise the database functionality. The C API provides the function calls without an object-oriented schema. Aside from the schematic differences, there are few distinctions between these C++ and C FairCom DB API APIs.
Quick Tutorials
FairCom provides four quick tutorials showing the major components of our core technology:
- How to init, define, and manage data
- How to handle index files
- How to use locks in a multi-user environment
- How to use transaction processing
You can find these tutorials in the ReadMe files for the FairCom DB API navigational interface. Each API has a set of tutorials as well as help installing FairCom DB and compiling your projects.
Navigational record-oriented interfaces:
| Language | Notes |
Drivers Folder (V12 location) |
Nickname |
|---|---|---|---|
| C | Record-oriented C API | c.nav | ctdb |
| C++ | Record-oriented C++ API | cpp.nav | ctpp |
| C# | Record-oriented Microsoft C# .NET API | csharp.nav | |
| Java | Record-oriented Java API | java.nav | jtdb |
| JPA Hibernate | Java | java.jpa.nav | ctree.isam.jpa |
| Node.js JavaScript - NAV | Record-oriented API for JavaScript | nodejs.nav | c-tree Node.js Module |
| Python FairCom NAV | Record-oriented API for Python | python.nav | Python NAV |
| Visual Basic | Record-oriented API for Microsoft Visual Basic .NET | vb.nav | vtdb |
| VCL | Record-oriented API for VCL data components for Embarcadero Delphi | (available from FairCom) | dtdb |
You can find tutorials and information about the entire set of FairCom APIs in the following ReadMe:
The ReadMe files document the very basic tutorials packaged with the product. On the FairCom website you can find highly informative interactive tutorials:
These tutorials cover the major programming languages that FairCom DB API supports and go in depth to illustrate best practices for multi-threaded environments with SQL compatibility.
Programming with FairCom DB API
FairCom DB API, short for c-tree DataBase, represents a higher-level, easier-to-use API on top of the two popular FairCom APIs: ISAM and Low-level. FairCom DB API is intended as the standard for c-tree programming. FairCom DB API makes the developer’s life easier without removing the flexibility and performance of the original APIs.
The FairCom DB API general architecture is presented in the figure below, organized into seven different levels: session, database, table, field, index, segment, and record. These levels or layers will be used to present a group of common functionality.
It is important to note that c-tree data and index files can be manipulated directly with or without session or database dictionary support. Please refer to Working with Sessions without Dictionary Support and Creating a Table Object without Database Support for more information.
A Session represents a connection between a client and a c-tree Server; no work can be performed before a session becomes active. The session object indicates the c‑treeDB session, the server name and location, the directory where the databases are located, the user name and password.
A Database can be considered as a collection of tables, and each database has its own database dictionary that stores information about each table that belongs to that database: the table name, password and path, the active (open) tables, and the number of tables linked to the database. The database object indicates a database in the session and each session can have multiple databases.
A Table is essentially a c-tree Plus data file and optional index files. There can be, and typically are, more than one table in a database, and a given table may belong to multiple databases. A Table may have zero or more records.
A Field is the basic element of a table, and a collection of fields form a data record.
Often a table will have zero or more Indexes, which enhances the retrieval of records from that table.
Indexes typically have one or more Segments that describe the index key structure. The index object indicates an index associated with a particular table, while the segment links the index with the fields.
A Record is essentially an entry row in a table. A record object indicates a record instance on a particular table. A table may have one or more record objects associated with it. Each record handle may be an independent cursor into the table, or several record objects may share the same cursor into the table.