Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DatabaseClient::DatabaseClient(
- const char* hostname,
- const char* username,
- const char* password,
- const uint16_t port
- )
- #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
- : DatabaseClient(hostname, username, password, nullptr, port)
- {
- }
- #else
- : connection_(mysql_init(nullptr))
- {
- if (nullptr == connection_) {
- throw MySqlException("Unable to connect to MySQL");
- }
- const MYSQL* const success = mysql_real_connect(
- connection_,
- hostname,
- username,
- password,
- nullptr,
- port,
- nullptr,
- 0);
- if (nullptr == success) {
- MySqlException mse(connection_);
- mysql_close(connection_);
- throw mse;
- }
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement