Mania++
 All Classes Functions Variables Pages
Public Member Functions | Public Attributes | Private Attributes | List of all members
Database Class Reference

Handles the connection to the database. More...

#include <Database.h>

Public Member Functions

 Database (std::string serverAddress, int serverPort=3306)
 Sets a few settings. More...
 
 ~Database ()
 
sql::Connection * Connect (std::string username, std::string password, std::string database)
 Connects to the database. More...
 

Public Attributes

sql::Driver * Driver
 Database server driver.
 
sql::Connection * Connection
 Database server driver.
 

Private Attributes

std::string address
 IP Address of the database server.
 
int port
 Port of the database server.
 

Detailed Description

Handles the connection to the database.

Constructor & Destructor Documentation

Database::Database ( std::string  serverAddress,
int  serverPort = 3306 
)

Sets a few settings.

Parameters
serverAddressIP Address of the database server.
serverPortPort of the database server.
Database::~Database ( )

Deconstructor closes driver thread.

Member Function Documentation

sql::Connection * Database::Connect ( std::string  username,
std::string  password,
std::string  database 
)

Connects to the database.

Parameters
usernameDatabase user name.
passwordDatabase user password.
databaseDatabase name.

The documentation for this class was generated from the following files: