Introduction
MySQL Connector/C++ is a MySQL database connector for C++.
The MySQL Connector/C++ is licensed under the terms of the GPL,
like most MySQL Connectors. There are special exceptions to the terms
and conditions of the GPL as it is applied to this software, see FLOSS License Exception. If you need a non-GPL license for commercial distribution please contact us.
The MySQL Driver for C++ mimics the JDBC 4.0 API.
However, Connector/C++ does not implement all of the JDBC 4.0 API. The
Connector/C++ 1,0.5 GA release features the following classes:
- Connection
- DatabaseMetaData
- Driver
- PreparedStatement
- ResultSet
- ResultSetMetaData
- Savepoint
- Statement
The MySQL Connector/C++ implements a significant subset of JDBC 4.0.
The JDBC API defines some 450 methods for the above mentioned classes.
About 375 (= 80%) of them are implemented and available with the alpha
release.
In total you will find about 570 being declared in Connector/C++
and approximately 460 of them being implemented, please check the simplified implementation statistics (1.0.3alpha, 1.0.2alpha for details. Please note, we remove method stubs from releases and you will find only fully implemented methods in a release.
The Driver for C++ can be used to connect to MySQL 5.1 or later.
Note - its full functionality is not available when connecting to MySQL
5.0. You cannot connect to MySQL 4.1 or earlier.
Download
You can download the MySQL Connector/C++ at http://dev.mysql.com/downloads/connector/cpp/1.0.html
As of 1.0.4beta we offer both binary and source packages. Available binary packages:
- Windows
- Without Installer (zip)
- MSI Installer
- Other
- Compressed GNU TAR archive (tar.gz)
Available source packages:
- All Platforms
- Compressed GNU TAR archive (tar.gz)
Source repository
The latest development version is also available through Launchpad at https://launchpad.net/mysql-connector-cpp .
Bazaar
is used for the MySQL Connector/C++ code repository. You can check out
the source using the bzr command line tool (current development branch):
bzr branch lp:~mysql/mysql-connector-cpp/trunk
Supported Platforms
The beta release has been successfully compiled and tested on the following platforms:
- AIX
- 5.3 (PPC32, PPC64)o
- FreeBSD
- 6.0 (x86, x86_64)!
- 7.0 (x86, x86_64)o
- HPUX
- 11.11 (PA-RISC 32bit, PA-RISC 64bit)*
- 11.23 (iA64)o
- 11.31 (PA-RISC 32bit, PA-RISC 64bit)*
- 11.31 (iA64)o
- IBM i5/OS
- i5/OS (POWER, 32-bit, POWER, 64-bit)!
- Linux
- FC4 (x86)
- RHEL 3 (ia64, x86, x86_64)!
- RHEL 4 (ia64, x86, x86_64)o
- RHEL 5 (ia64*, x86, x86_64)o
- SLES 9 (ia64, x86, x86_64)o
- SLES 10 (ia64, x86_64)o
- SuSE 11.0, (x86_64)
- Ubuntu 8.04 (x86)
- Ubuntu 8.10 (x86_64)
- Mac
- MacOSX 10.4 (PPC32*, PPC64*, x86)
- MacOSX 10.5 (PPC32*, PPC64*, x86, x86_64)
- MacOSX 10.6 (x86, x86_64)
- SunOS
- Solaris 8 (SPARC32, SPARC64, x86)
- Solaris 9 (SPARC32, SPARC64, x86)
- Solaris 10 (SPARC32, SPARC64, x86, x86_64)
- Solaris 11 (x86, x86_64)*
- OpenSolaris 2008.11 (x86)
- Windows
- XP Professional (32bit)
- 2003 (64bit)
An asterix after the platform means that the latest version of the
MySQL Enterprise Server may no longer or not yet be supported on that
platform but we know, however, that one can build Connector/C++ on that
platform.
Future versions aim to support as many of the platforms for which
commercial support is available for the latest GA version of the MySQL
Server as possible. Please check the support policies at http://www.mysql.com/support/supportedplatforms/enterprise.html for details.
For sales related questions, for example on support or commercial licenses, please write to <sales@mysql.com>.
Advantages
Using MySQL Connector/C++ instead of the MySQL C API (MySQL Client Library) offers the following advantages for C++ users:
- Convenience of pure C++ - no C function calls
- Support of a well designed API - JDBC 4.0
- Support of a commonly known and well documented API - JDBC 4.0
- Support of the object oriented programming paradigma
- Shorter development times
Status
MySQL Connector/C++ is available as production version. We kindly ask
users and developers to try it out and provide us with feedback.
MySQL Workbench is using a pre-alpha code snapshot for its
internal development version. The same is true for the MySQL
Connector/OpenOffice.org.
[edit] Binary Installation
Unpack the archive into an appropriate directory.
If you plan to use a dynamically linked version of MySQL
Connector/C++, make sure that your system can find the MySQL client
library. Consult your operating system documentation on how do modify
and expand the search patch for libraries. In case you cannot modify the
library search path it may help to copy your application, the MySQL
Connector/C++ library and the MySQL client library into the same
directory. Most systems search for libraries in the current directory.
Please read also Connector C++ Binary Builds for notes on binary portability.
[edit] CAUTION: binary compatibility on Windows
The Visual Studio builds of Connector/C++ must not be used with any
other CRT (C Run-Time Library, provided by Windows/Visual Studio) but
the ones listed at Connector C++ Binary Builds
. Using any other CRT with your C++ client application than what we
used to build the Connector/C++ binary may cause issues. The Microsoft
Visual Studio documentation points out the [potential errors passing CRT
objects across DLL boundaries http://msdn.microsoft.com/en-us/library/ms235460.aspx].
Furthermore, your C++ client application must use the same compiler
settings for /MD (dynamic linking of CRT), /MDd (dynamic linking of CRT
with debug), /MT (static linking of CRT) and /MTd (static linking of CRT
with debug). The settings used for building Connector/C++ binaries are
documented at the wiki page Connector C++ Binary Builds.
The major version of the compiler used to build the Connector/C++
driver library must match the version of the compiler used to build
your C++ client application that is using Connector/C++. For example,
you must not use Visual Studio 2008 to link your C++ client application
against a Connector/C++ driver library that was build with Visual Studio
2005.
For those combinations of compiler version, target CRT version
and your target compiler settings (/MD, /MDd, /MT, /MTd) for which we do
not provide a binary download, you have to build Connector/C++ from
source.
[edit] Windows MSI Installer
Windows users can choose between two binary packages: without installer (unzip in C:\) and Windows MSI Installer (x86).
Using the MSI Installer may be more comfortable. Running the MSI
Installer does not require any administrative permissions because all it
does is to copy files.
The "Typical" installation consists of all required header files
and the Release libraries. The only available "Custom" installation
option allows you to install additional Debug versions of the driver
libraries.