CopperSpice Overview  1.5.1
SQL Drivers

How to Configure and Install CsSql Drivers

The CsSql library uses plugins to communicate with the different database APIs. The API is the same for all databases. Several SQL drivers are supplied with CS and other drivers can be built if needed.

Supported Databases

The table below lists the SQL drivers supported with CopperSpice. Due to GPL license restrictions not all of the plugins can be provided.


Driver Name DBMS Supported
QDB2 IBM DB2 Plugin
QIBASE Borland InterBase Plugin
QMYSQL MySQL Plugin
QOCI Oracle Call Interface Driver Plugin
QODBC Microsoft SQL Server & other ODBC compliant databases Plugin
QPSQL PostgreSQL Plugin
QSQLITE SQLite Built In


SQLite is the in-process database system with the best support on all platforms. Oracle via OCI, PostgreSQL and MySQL using ODBC or the native driver are commonly used on Windows and Linux. Support for the other drivers depend on the availability and quality of client libraries.

To build a driver plugin for your Database Management System (DBMS), the appropriate client library must be installed on your system.

Building SQL Drivers

The CopperSpice configure script will automatically detect the available client libraries installed on your computer. If configure detects a DBMS, the appropriate SQL drivers will be built.

The configure script may need to be passed additional parameters to specify your correct path for the DBMS header files and library files. The following is an example for building the plugin drivers for PostgreSQL.

  • Unix or Linux - PostgreSQL was installed using the official Debian package
../cs/configure CFLAGS="-I/usr/include/postgresql"


  • Windows - PostgreSQL 9.1 is installed in "C:\Program Files\PostgreSQL\9.1\"

    These flags can be passed to configure or added to the config-cs script file. For information about the config-cs file refer to Building CS for Windows
../cs/configure CFLAGS="-I/c/Progra~1/PostgreSQL/9.1/include" LDFLAGS="-L/c/Progra~1/PostgreSQL/9.1/lib"


  • Mac OS X - PostgreSQL 9.1 was installed using MacPorts
../cs/configure CFLAGS="-I/opt/local/include/postgresql91/" LDFLAGS="-L/opt/local/lib/postgresql91/"

Required Client Libraries

In addition to the SQL driver plugin client library files may be also be required. As an example, for PostgreSQL 9.1 on Windows, the following DLL files may be required and should be copied to your deploy folder.

  • libiconv-2.dll
  • libintl-8.dll
  • libpq.dll

The exact files your application will require depends on your OS and the version of the DBMS. On Unix use ldd, on Windows use Dependency Walker, and on Mac OS X use otool to determine which files your plugin will require.

Additional Information

The following information explains the basic concepts for each DBMS.