本文共 1133 字,大约阅读时间需要 3 分钟。
说起链接数据库,不少C++的人都有着不同的经历,什么.NET,DAO,ADO,ODBC,各类数据库的API库,你是不是还头疼于跨平台的移植性呢。有啥能像Java那样来,哎....
那我还是劝你考虑考虑使用 SQLAPI++ Library
我只是推荐哈,毕竟SQLAPI++是需要购买的
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, see ) |
SQLite | Supported | Supported |
看看上边的表,是不是你所使用的数据库都支持了呢?!
其实用起来也是相当简单的。
. Connecting to database (and error handling)
. Executing a simple SQL command. Binding input parameters Executing a select query (and fetching result set) Binding LongBinary, LongChar, BLob and CLob data Fetching LongBinary, LongChar, BLob and CLob data Multithreading support and canceling queries
顺者链接看过去,我相信,没多长时间你就掌握了。
转载地址:http://htgmb.baihongyu.com/