SQLAPI - C library for accessing SQL data...

来源:百度文库 编辑:神马文学网 时间:2024/04/29 04:38:07
SQLAPI++ Library
SQLAPI++ is a C++ library for accessing multiple SQL databases (Oracle, SQL Server, DB2, Sybase, Informix, InterBase, SQLBase, MySQL, PostgreSQL and ODBC, SQLite). It uses native APIs of target DBMS so applications developed with SQLAPI++ library run swiftly and efficiently. The product 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. See details on supporting SQL database servers on different platforms:
Server Win32 Linux/Unix
Oracle Database Server Supported (OCI) Supported (OCI)
Microsoft SQL Server Supported (DB-Library, OLE DB) FreeTDS ODBC driver should be used
Sybase Supported (Open Client, ASE & ASA) Supported (Open Client, ASE & ASA)
DB2 Supported (DB2 CLI) Supported (DB2 CLI)
Informix Supported (Informix CLI) Supported (Informix CLI)
InterBase/Firebird Supported Supported
Centura (formerly Gupta) SQLBase Supported (CAPI) Supported (CAPI)
MySQL Supported (MySQL C API)  Supported (MySQL C API)
PostgreSQL Supported (libpq) Supported (libpq)
ODBC Supported Supported (iODBC, seewww.iodbc.org)
SQLite
Supported
Supported
Currently SQLAPI++ library supports the following C/C++ compilers:
Microsoft Visual C++ Borland C++ Builder GNU project C and C++ compiler
Why use SQLAPI++?
SQLAPI++ directly calls native API's of target DBMSs (unlike ADO which uses OLEDB and/or ODBC intermediate layer). That's why SQLAPI++ is the fastest way to manage you data. 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, bugs fixing and new version updates.
Examples
Steps
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. Multithreading support and canceling queries
Advanced Examples
Using Oracle REF CURSORs
Using Oracle nested cursors
Fetching records in bulk
History
12 September 2008
Version 3.7.25 of SQLAPI++ library released.
New features:
General: saConnectionHandler_t callback added at SAConnection::Connect method. SQLServer: SQLCE, "CreateDatabase" option added. SQLServer: SQLCE, use SA_dtString program type for uniqueidentifier fields. Oracle: Fixed memory leak when SYS_REFCURSOR parameters returns a cursor field (thanks mera.ru) General: Added compilation option SA_UNICODE_WITH_UTF8. Used with MySQL to turn on utf-8 client character set for SA_UNICODE configuration. General: SA_UNICODE configuration. Added SAString methods GetUTF8Chars, GetUTF8CharsLength, SetUTF8Chars. Oracle: Fixed option processing OCI_ATTR_CHARSET_FORM=SQLCS_NCHAR for NCLOB binding (thanks Andreas Wenzel). Oracle: Fixed binding(SA_UNICODE) CLOB procedure parameters (thanks Marcel Rassinger). General: Fixed 'SANumeric::operator double() const' bug with locale settings those use a special character as a decimal delimiter instead of '.'. SQLite: Added new API functions - sqlite3_threadsafe and sqlite3_last_insert_rowid. SQLite: Fixed wrong API initialization (thanks Peter Klotz). SQLite: Added "BusyTimeout" connection option. General: Added version info into sqlapi.dll (thanks Frank Hilliger). Sybase: SACommand::Cancel should work now (thanks Georgiy Pakhutin). SQLServer: OLEDB, SACommand::Cancel works with multiple results (required SQLNCLI, thanks Georgiy Pakhutin). SQLServer: OLEDB, the default value of "ICommadPrepare" option was changed to "skip". Sybase: "SybaseResultType" and "SybaseResultCount" SACommand options added. Sybase: SAGlobals::SetSybaseMessageCallback method added (EXPERIMENTAL, allows to process Sybase messages manually). DB2: Added mapping DECFLOAT<->SA_dtString(thanks Dmitry Chaikovsky).
26 February 2008
Version 3.7.24 of SQLAPI++ library released.
New features:
MySQL: Connection options MYSQL_OPT_READ_TIMEOUT, MYSQL_OPT_WRITE_TIMEOUT and MYSQL_OPT_CONNECT_TIMEOUT added. MySQL: Version 5.1 supported now. Oracle: CLOB/BLOB truncation bug fixed. Oracle: REFCURSOR memory leak problem fixed. SQLite: Initial support for SQLite added. ODBC: Added the special code for situations when the ODBC driver returns 0 bytes instead of SQL_NO_DATA (LongChar reading, thanks Frank Hilliger). SQLServer: SQLOLEDB layer modified for Compact Edition 3.5. SQLServer: Added Compact Edition specific options. Now CE layer is available at UNICODE version only. DB2: Fixed the problem with column names (UNICODE version, thanks Adrian Studer). General: Fixed the problem with the SANumeric rounding (thanks Mike Moening). MySQL: Added SAInterval parameter processing (thanks Frank Hilliger).
12 October 2007
Version 3.7.23 of SQLAPI++ library released.
New features:
PostgreSQL: The error message includes the diagnostic trouble code now (thanks Helmut Ebersmann). MySQL: Fixed bug with affected rows value (thanks Christoph Merten). MySQL: Fixed bug with datetime/timestamp second part/fraction (thanks Helmut Ebersmann). General: SACommand::ParseInputMarkers fixed for tabulator after parameter name (thanks Adrian Studer). SQLServer: IssOleDbCursor::SetParameterInfo fixed for correct type name (thanks to Phillip at spectorsoft.com). SQLServer: SQLOLEDB layer works with Compact/Mobile edition now (SQLAPI should be compiled with SA_UNICODE, thanks John Hague). Sybase: New scheme of the client API libraries loading , SA_INCLUDES_SYBASE building parameter added (thanks Max Hales). Sybase: CS_LOGIN_TIMEOUT and CS_TIMEOUT connection parameters added (thanks Beaty, Robert). Oracle/General: Fixed issue with SANumeric/double conversion (thanks Adrian Studer). Oracle: Fixed problem with CLOB and varying-width client-side character sets (UTF-8). General: Build scripts updated. More samples are provided now.
25 June 2007
Version 3.7.22 of SQLAPI++ library released.
New features:
PostgreSQL: Fixed string escaping bug (buffer size too small, thanks combit.net). SQL Server: Added statement preparation for each executing when option "ICommandPrepare" = "SetParameterInfo" used (thanks to Chris Hecker). SQL Server: Fixed string parameters buffer size bug on x86_64/SQLOLEDB. MySQL: Fixed access violation bug with fetching empty text field data (thanks Albert Perdon). MySQL: Fixed bug with non-initialized statement handle (thanks Mario Lavalliere). ODBC: The code modified to work correctly with long/blob fields under Linux and FreeTDS driver. ODBC: SAConnection::isAlive() uses SQLGetConnectAttr/SQL_ATTR_CONNECTION_DEAD now. SQL Server: Added SAConnection parameter "OLEDBProvider" (SQLOLEDB connection).
24 May 2007
Version 3.7.21 of SQLAPI++ library released.
New features:
Oracle: "APPNAME" SAConnection parameter added (OCI_ATTR_CLIENT_IDENTIFIER is used, thanks Frank Hilliger). MySQL: Fixed bug with SAConnection::isAlive(). SQL Server: "ICommandPrepare" SACommand parameter value "SetParameterInfo" added (fixesKB235053). MySQL: "UseStatement" SACommand parameter added (SQLAPI++ can use MySQL statement API now). MySQL: Fixed long character type support with UNICODE. Oracle: Fixed CLOB type support with UNICODE. ODBC: Fixed access violation bug at IodbcConnection::Check (UNICODE, thanks Jay Sridhar). DB2: Fixed possible access violation bug at Idb2Connection::Check (UNICODE).
30 March 2007
Version 3.7.20 of SQLAPI++ library released.
New features:
Sybase: Version 15.x support for Linux/UNIX (.so names changed - thanks Ronan O'Sullivan). Oracle: Crash fixed with the OCIDateTime descriptor freeing. DB2: Unicode support improved. General: Added common SAConnection option: "APPNAME", "WSID" (they are supported for SQL Server and Sybase at the moment). SQL Server (OLDEDB): Added SAConnection options SSPROP_INIT_FILENAME, SSPROP_INIT_ENCRYPT, SSPROP_INIT_WSID. PostgreSQL: Added using of the PQescape* functions if they are available. DB2: SA_dtString procedure parameter type is used for the LONG VARCHAR database type. MySQL: Added support for multiple result set. SQL Server (OLDEDB): x86_64 fixes. DB2: All diagnostic messages are combined into SAException error text now. Sybase: CS_HAFAILOVER connection parameter added. General: Fixed a SADateTime::TmFromDate problem with the rounding. DB2: XML type support added. DB2: Fixed x86_64 support.
28 December 2006
Version 3.7.19 of SQLAPI++ library released.
New features:
Oracle: Added procedure/function support for Oracle PL/SQL BOOLEAN type. Oracle: Support for BINARY_FLOAT and BINARY_DOUBLE types. Oracle: Memory leak fixed with SYS_REFCURSOR & TIMESTAMP/BLOB/CLOB fields. General: Added bool& SAGlobals::UnloadAPI() - prevent from DBMS API unloading. General: SADateTime::SADateTime(double dt) - round the fraction result to microseconds. General: Added SAInterval class for time intervals (experimental, only MySQL support for now). MySQL: Support for multi-result statements. MySQL: Set by default connection flags CLIENT_MULTI_STATEMENTS and CLIENT_MULTI_RESULTS. SQLBase: Fixed access violation at sqldes() C API function with SQLBase version 10. MySQL: Added support for the 'bit' type. PostgreSQL: Fixed problem with bytea/text on AIX 64-bit (seems common 64-bit platform problem). Sybase: Fixed MinGW version. ODBC: Windows x64 fixes. Should work now. Oracle: Fixed bug with DateTime parameters and an execution of prepared statements.
27 September 2006
Version 3.7.18 of SQLAPI++ library released.
New features:
General: Added SACommand::operator << (unsigned short Value) and SACommand::operator << (unsigned long Value) MySQL: Added "CharacterSet" SAConnection option. Oracle: Fixed bug with SADateTime to Oracle OCIDateTime conversion. SQLServer: Fixed bug when it was impossible to fetch several result sets with single query. MySQL: Added mysql_thread_init() and mysql_thread_end() API functions. MySQL: Added mysql_server_end() call before MySQL client library is released.
16 August 2006
Version 3.7.17 of SQLAPI++ library released.
New features:
General: AIX, HP-UX and MacOS X support improved.
SQLServer: Added SSPROP_INIT_MARSCONNECTION connection (OLEDB) option.
PostgreSQL: Server side cursor implemented for 'SELECT ...' statements. InterBase: Modified to start transaction only when query executed (thanks Fabrice Aeschbacher). General: New SQLAPI++ data types added: SA_dtUShort and SA_dtULong.
General: Added SAString methods SAString::MakeUpper(), SAString::MakeLower(). General: Experimental 'scrollable cursor' functionality implemented (PostgreSQL,MSSQL,ODBC thanks combit.net). General: Fixed SACommand::ParseInputMarkers for '=' parameter name delimiter. Oracle: Fixed memory leaks and troubles with BLOB and TIMESTAMP descriptors. Oracle: UNICODE version uses UCS2 client character set. Oracle: Fixed bug at IoraConnection::CnvtNumericToInternal with numbers like [-]0.001 Oracle: Fixed memory leak with temporary BLOBs (thanks Frank Hilliger). General: Experimental methods SAConnection::Destroy() added (to destroy broken connection). General: Experimental method SAConnection::isAlive() added (to check if a remote database is alive). MySQL: mysql_ping was removed from SAConnection::IsConnected(). ODBC: Fixed column size and precision for SADateTime input parameters. Sybase: Fixed "CS_HOSTNAME" connection option (thanks Ulrich Gievers). Sybase: Bug fixed with INTEGER-s on x86-64. MySQL: Bug fixed long text/binary procedure parameters. Oracle: New SAConnection "UseTimeStamp" option (controls if SQLAPI should use Oracle TIMESTAMP functions). Oracle: Fixed bug with procedure datetime parameters. DB2: Fixed bug with INTEGER-s on x86-64. ODBC: Fixed bug with SAException::ErrMsg() at UNICODE configuration. UNICODE support improved. General: Fixed bug at SAString::FormatV(...) on Linux/UNIX (thanks Michael Teske). SQLServer: DB-Library client included into MinGW build. MySQL: Fixed the procedure parameters parsing code.