MySQL Connector/C++ Developer Guide  /  Introduction to Connector/C++

Chapter 1 Introduction to Connector/C++

MySQL Connector/C++ 8.0 is a MySQL database connector for C++ applications that connect to MySQL servers. Connector/C++ can be used to access MySQL servers that implement a document store, or in a traditional way using SQL queries. It enables development of C++ applications using X DevAPI, or plain C applications using X DevAPI for C.

Connector/C++ 8.0 also enables development of C++ applications that use the legacy JDBC-based API from Connector/C++ 1.1. However, the preferred development environment for Connector/C++ 8.0 is to use X DevAPI or X DevAPI for C.

Connector/C++ applications that use X DevAPI or X DevAPI for C require a MySQL server that has X Plugin enabled. For Connector/C++ applications that use the legacy JDBC-based API, X Plugin is not required or supported.

For more detailed requirements about required MySQL versions for Connector/C++ applications, see Platform Support and Prerequisites.

For notes detailing the changes in each release of Connector/C++, see MySQL Connector/C++ Release Notes.

Connector/C++ Benefits

MySQL Connector/C++ offers the following benefits for C++ users compared to the MySQL C API provided by the MySQL client library:

  • Convenience of pure C++.

  • Supports these application programming interfaces:

    • X DevAPI

    • X DevAPI for C

    • JDBC 4.0-based API

  • Supports the object-oriented programming paradigm.

  • Reduces development time.

  • Licensed under the GPL with the FLOSS License Exception.

  • Available under a commercial license upon request.

Connector/C++ and X DevAPI

Connector/C++ implements X DevAPI, as described in X DevAPI User Guide. X DevAPI enables connecting to MySQL servers that implement a document store with X Plugin. X DevAPI also enables applications to execute plain SQL queries.

Connector/C++ and X DevAPI for C

Connector/C++ implements a plain C interface called X DevAPI for C that offers functionality similar to that of X DevAPI and that can be used by applications written in plain C. X DevAPI for C enables connecting to MySQL servers that implement a document store with X Plugin. X DevAPI for C also enables applications to execute plain SQL queries.

Connector/C++ and JDBC Compatibility

Connector/C++ implements the JDBC 4.0 API, if built to include the legacy JDBC connector:

The Connector/C++ JDBC API is compatible with the JDBC 4.0 API. Connector/C++ does not implement the entire JDBC 4.0 API, but does feature these classes: Connection, DatabaseMetaData, Driver, PreparedStatement, ResultSet, ResultSetMetaData, Savepoint, Statement.

The JDBC 4.0 API defines approximately 450 methods for the classes just mentioned. Connector/C++ implements approximately 80% of these.

Note

For more information about the using the Connector/C++ JDBC API, see MySQL Connector/C++ 1.1 Developer Guide.

Platform Support and Prerequisites

To see which platforms are supported, visit the Connector/C++ downloads page.

Commercial and Community Connector/C++ distributions require the Visual C++ Redistributable for Visual Studio 2015 to work on Windows platforms. The Redistributable is available at the Microsoft Download Center; install it before installing Connector/C++.

These requirements apply to building and running Connector/C++ applications, and to building Connector/C++ itself if you build it from source:

  • To build Connector/C++ applications:

    • The MySQL version does not apply.

    • On Windows, Microsoft Visual Studio 2015 is required.

  • To run Connector/C++ applications, the MySQL server requirements depend on the API the application uses:

    • Applications that use the JDBC API can use a server from MySQL 5.5 or higher.

    • Connector/C++ applications that use X DevAPI or X DevAPI for C require a server from MySQL 8.0 (8.0.11 or higher) or MySQL 5.7 (5.7.12 or higher), with X Plugin enabled. For MySQL 8.0, X Plugin is enabled by default. For MySQL 5.7, it must be enabled explicitly. (Some X Protocol features may not work with MySQL 5.7.)

    In addition, applications that use MySQL features available only in MySQL 8.0 or higher require a server from MySQL 8.0 or higher.

  • To build Connector/C++ from source:

    • The MySQL C API client library may be required:

      • Building the JDBC connector requires a client library from MySQL 5.7 (5.7.9 or higher) or MySQL 8.0 (8.0.11 or higher). This occurs when Connector/C++ is configured with the WITH_JDBC CMake option enabled to include the JDBC connector.

      • For Connector/C++ built without the JDBC connector, the client library is not needed.

    • On Windows, Microsoft Visual Studio 2015 is required.


User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.