• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

The no-code and full-code software development tool for distributed control systems and HMI

  • Doc
  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Products
    • Automation Designer
    • HMI Designer
    • Maritime HMIs
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • MariaDB C++ Classes
  • MariaDBFactory
  • 5.0.0

MariaDBFactory Class

(MariaDB::MariaDBFactory)

Creates a CDP2SQL::IDatabaseConnection object capable of connecting to a MySQL or MariaDB database. This should be passed into CDP2SQL::Database constructor. More...

Header: #include <MariaDBFactory>
  • List of all members, including inherited members

Public Functions

virtual IMariaDBConnection *Create(const std::string &host, const std::string &userName, const std::string &password, const std::string &unixSocket = "")

Detailed Description

Creates a CDP2SQL::IDatabaseConnection object capable of connecting to a MySQL or MariaDB database. This should be passed into CDP2SQL::Database constructor.

#include <CDP2SQL/CDP2SQL.h>
#include <MariaDB/MariaDBFactory.h>
...
Database db(MariaDB::MariaDBFactory().Create("127.0.0.1:3306", "user", "password"), "database-name");

Member Function Documentation

[virtual] IMariaDBConnection *MariaDBFactory::Create(const std::string &host, const std::string &userName, const std::string &password, const std::string &unixSocket = "")

Creates a CDP2SQL::IDatabaseConnection object capable of connecting to a MySQL or MariaDB database. This should be passed into CDP2SQL::Database constructor.

  • host - Hostname (IP and port) to connect to. For example "127.0.0.1:3306"
  • userName - Username to log in with
  • password - Password for the user to log in with (may be empty)
  • unixSocket - Path of unix socket to connect to. If specified, host and port will be ignored

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

My account

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

© Copyright 2025 CDP Technologies. Privacy and cookie policy.

Return to top