DBConnection Class Reference

#include <DBConnection.h>

Collaboration diagram for DBConnection:

[legend]
List of all members.

Public Member Functions

void setUser (string u)
void setPassword (string p)
void setDatabase (string d)
bool isConnected ()
void connect ()
void disconnect ()
Statement * createStatement (string q)
void terminateStatement (Statement *s)
void commit ()
void rollback ()
Clob * createClob ()

Static Public Member Functions

static DBConnectiongetConnection ()

Detailed Description

Class used to manage the connection to the database. This is a singleton class, you can not call the constructor. Instead, you must call the DBConnection::getConnection() static method.


Member Function Documentation

void DBConnection::commit (  ) 

Commit everything since last commit/rollback

void DBConnection::connect (  ) 

Try to connect to the database. Throws a SQLConnection exception in case of problem.

Clob * DBConnection::createClob (  ) 

Creates an uninitialized Clob

Statement * DBConnection::createStatement ( string  q  ) 

Create a statement from the connection. Throws a SQLException or a Exception in case of problem. Once used, you MUST call the terminateStatement method on the statement.

Parameters:
q The query you want to send
Returns:
A pointer on the newly created statement

void DBConnection::disconnect (  ) 

Try to disconnect from the database. Throws a SQLConnection exception in case of problem.

DBConnection * DBConnection::getConnection (  )  [static]

Get a pointer on the unique instance of the class. Creates the object if needed.

Returns:
A pointer on the unique DBConnection object

bool DBConnection::isConnected (  ) 

Check if we are connected to the database

Returns:
True if the connection has been performed, false otherwise

void DBConnection::rollback (  ) 

Rollback everything since last commit/rollback

void DBConnection::setDatabase ( string  d  ) 

Set the database connection string

Parameters:
d The connection string

void DBConnection::setPassword ( string  p  ) 

Set the database user password

Parameters:
p The user password

void DBConnection::setUser ( string  u  ) 

Set the database user name

Parameters:
u The user name

void DBConnection::terminateStatement ( Statement *  s  ) 

Terminate the given statement.

Parameters:
s A pointer on the statement to close.


The documentation for this class was generated from the following files:
Generated on Tue Feb 28 15:35:34 2012 for ILCConfigurationDB by  doxygen 1.4.7