Nemiver  0.3
Static Public Member Functions | List of all members
nemiver::common::ConnectionManager Class Reference

declaration of the entry point of the db abstraction layer. this class has the capacity to set the type of the db driver we want to use, connect to a database and return a #Connection object. More...

#include <nmv-connection-manager.h>

Static Public Member Functions

static void create_db_connection (const common::UString &a_connection_string, const common::UString &a_user, const common::UString &a_pass, Connection &a_connection)
 connect to a db specified by a uri note that this function throws an #Exception if fails. More...
 
static ConnectionSafePtr create_db_connection ()
 create a connection to the default database. The default database is the one configured by the user by filling the file nemiver.conf. More...
 
static const char * get_db_type ()
 get the type of database we are using. More...
 

Detailed Description

declaration of the entry point of the db abstraction layer. this class has the capacity to set the type of the db driver we want to use, connect to a database and return a #Connection object.

Member Function Documentation

◆ create_db_connection() [1/2]

static ConnectionSafePtr nemiver::common::ConnectionManager::create_db_connection ( )
static

create a connection to the default database. The default database is the one configured by the user by filling the file nemiver.conf.

Returns
a smart pointer to a useable db connection. Throws an Exception if it fails.

◆ create_db_connection() [2/2]

static void nemiver::common::ConnectionManager::create_db_connection ( const common::UString a_connection_string,
const common::UString a_user,
const common::UString a_pass,
Connection a_connection 
)
static

connect to a db specified by a uri note that this function throws an #Exception if fails.

Parameters
a_connection_stringa uri specifing the db we want to connect to. the uri ressembles: vdbc:dbtypename://[host:[port]]/[nameofthedbinstance]
a_userthe username to access the db
a_passthe password to access the db
a_connectionout parameter. The connection initialized by the function upon successful completion.

◆ get_db_type()

static const char* nemiver::common::ConnectionManager::get_db_type ( )
static

get the type of database we are using.

Returns
a null terminated string that may be "mysql", "sqlite" etc ...

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