SQLAPI++ is a C++ library for accessing multiple SQL databases (Oracle, SQL Server, DB2, Sybase, Informix, InterBase, SQLBase, MySQL, PostgreSQL, SQLite, SQL Anywhere and ODBC).

The library uses native APIs of a target DBMS so applications developed with SQLAPI++ library provide unified access to most database operations. The library also provides a low-level interface that allows developers to access database-specific features.

By encapsulating a vendor's API, SQLAPI++ library acts as middleware and delivers database portability.

The details on supporting different SQL clients on different platforms are shown below.

ServerWindowsLinux/Unix
OracleOCIOCI
Microsoft SQL ServerSQLNCLI ODBC, OLE DB, DB-LibrarySQLNCLI ODBC for Linux x86-64, via ODBC driver on other systems (FreeTDS, Easysoft, ...)
SybaseOpen Client, ASE & ASAOpen Client, ASE & ASA
DB2DB2 CLIDB2 CLI
InformixInformix CLIInformix CLI
InterBase, FirebirdInterBase APIInterBase API
SQLBaseCAPICAPI
MySQL, MariaDBMySQL C API MySQL C API
PostgreSQLlibpqlibpq
ODBCODBC APIiODBC, unixODBC
SQLitesqlite3 C Interfacesqlite3 C Interface
Sybase SQL AnywhereSQL Anywhere C APISQL Anywhere C API

Currently SQLAPI++ library supports the following C/C++ compilers:

  • Microsoft Visual C++
  • Embarcadero (Borland) C++
  • GNU GCC C++ compiler
  • Solaris Studio C++ compiler

SQLAPI++ Benefits

  • SQLAPI++ directly calls native API's of target DBMSs (unlike ADO which uses OLEDB and/or ODBC intermediate layer).
  • No need (vs. ADO) to install and configure OLEDB and/or ODBC drivers when developing and distributing your applications.
  • Low-level interface that allows developers to access database-specific features.
  • SQLAPI++ ships with all the sources.
  • Free lifetime support, one year bugs fixing and new version updates.

Examples

Step 1.Connecting to database (and error handling)
Step 2.Executing a simple SQL command
Step 3.Binding input parameters
Step 4.Executing a select query (and fetching result set)
Step 5.Binding LongBinary, LongChar, BLob and CLob data
Step 6.Fetching LongBinary, LongChar, BLob and CLob data
Step 7.Multi-threading support and canceling queries
Advanced Examples

Using Oracle REF CURSORsUsing Oracle nested cursorsFetching records in bulk

Latest Releases

5.0.2
November 15, 2019
General
CubeSQL
MySQL
ODBC
Oracle
SQL Server
SQLBase
New Features
  • SQLBase: Added option "SQLBaseUseDoubleForDecimal"
  • Oracle: Alwasy use timezone infromation when read date/time values wijt timezone
  • MySQL: Added version 8.x mysqlclient name into default library list (thanks Leo Namuco​)
  • General: Removed SAOptions::Option(int) method but added SAOptions::OptionName(int) one (thanks Christian Schmitz)
Bug Fixes
  • General: Fixed SAOptions::Option method bug, the problem with thread-safe execution (thanks Peter Klotz)
  • CubeSQL: Fixed "SHOW..." command execution (thanks Christian Schmitz)
  • MySQL: Fixed environment initialization flag initial value (thanks Peter Klotz)
  • ODBC: Fixed error message generation for Unicode Linux/Unix version (thanks Christian Schmitz)
  • MySQL: Fixed "UseMySQLKillQueryConnection" option processing
  • SQL Server (ODBC): Fixed bug with string truncation in Unicode version for Linux (thanks Jürgen Thoma)
  • General: Fixed SAPI initialization related memory leak (thanks Baerten Manuel)
  • SQL Server (ODBC): Fixed API loading on Linux
  • CubeSQL: Fixed crashing when the result set fields described without command executed (thanks Christian Schmitz)
5.0.1
October 17, 2019
General
CubeSQL
MySQL
PostgreSQL
Sybase
New Features
  • CubeSQL: Added cubeSqlAPI::Check method
Bug Fixes
  • General: Fixed SAPI/SAConnection loading (thanks Jacob Pedersen, Baerten Manuel and Jian Zhang)
  • General: Fixed SAPI/SAConnection destroying (thanks Baerten Manuel)
  • General: IBM XLCbuildscript fixes (thanks Frank Hilliger)
  • MySQL: New "UseMySQLKillQueryConnection" option fixes SACommand::Cancel problem (thanks Frank Hilliger)
  • Sybase: Fixed crash after connection failed
  • PostgreSQL: Fixed API loading (thanks David Bárcena Hilario)
5.0.0
September 20, 2019
General
CubeSQL
DB2
Informix
MySQL
ODBC
Oracle
SQL Anywhere
SQL Server
New Features
  • CubeSQL: Added 'data' API functions
  • CubeSQL: New connection option supported "SSLCertificatePath" and new SSL related values for "ConnectionEncryption" (thanks Christian Schmitz)
  • ODBC: Do not check the result of SQL_ATTR_ROW_ARRAY_SIZE statement attribute set (thanks Christian Schmitz)
  • MySQL: Prevent buffer allocation for LONG/LOB data when procedure parameters described (thanks Johannes Lipp)
  • Oracle: Added OCI direct path functions
  • General: SA_Snapshot isolation level value added
  • DB2: Use universal command for SACommand::isAlive method (thanks Frank Hilliger)
  • Informix: Do not use ODBC64 by default for 64-bit platforms but use SA_INFORMIX_ODBC64 build option
  • DB2: Do not use ODBC64 by default for 64-bit platforms but use SA_DB2_ODBC64 build option (thanks Frank Hilliger)
  • MySQL: Use INFORMATION_SCHEMA.PARAMETERS for getting function/procedure parameters
  • General: Added SAPI class added - DBMS API abstraction class that allows to use several API versions or the same DBMS client
  • SQL Anywhere: Added scrollable cursor support
  • ODBC: Removed SAException throwing when it cannot load some unused API functions (thanks Christian Schmitz)
  • SQL Server: Removed DB-Library support
  • Oracle: Removed OCI7 support
  • ODBC: "ODBCUseBigint" connection option added
  • General: SA_dtInt64 and SA_dtUInt64 value types added
Bug Fixes
  • SQL Server (OLEDB): Fixed the second call of SAConnection::Connect method (thanks Michael Soliman)
  • General: Fixed SAString constructors provided by SA_USE_STL build option (thanks Michael Soliman)
  • Oracle: Fixed external connection handles attaching (thanks Frank Hilliger)
  • SQL Anywhere: Crashing fixed when result set navigated (thanks Christian Schmitz)
  • General: sa_strncpy/sa_wcsncpy related fixes (thanks Manuel Baerten)

See full history...