Understanding the SQL Communications Area

All UltraLite C/C++ interfaces utilize the same UltraLite run time engine. The APIs each provide access to the same underlying functionality.

All UltraLite C/C++ interfaces share the same basic data structure for marshaling data between the UltraLite runtime and your application. This data structure is the SQL Communications Area or SQLCA. Each SQLCA has a current connection, and separate threads cannot share a common SQLCA.

Your application code must carry out the following tasks before connecting to a database:

  • Initialize a SQLCA. This prepares your application for communication with the UltraLite runtime.
  • Register your error callback function.
  • Start a database. This operation can be carried out as part of opening the connection.

The following functions are equivalent ways of carrying out these tasks.

Task Interface Function
Initialize SQLCA Embedded SQL db_init
C++ ULSqlca::Initialize
Initialize SQLCA and start database Embedded SQL

db_init

db_start_database

C++ The database is started as part of the connection function in UltraLite_DatabaseManager