#include <DBConnection.h>
Collaboration diagram for DBConnection:
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 DBConnection * | getConnection () |
| 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.
| q | The query you want to send |
| 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.
| bool DBConnection::isConnected | ( | ) |
Check if we are connected to the database
| void DBConnection::rollback | ( | ) |
Rollback everything since last commit/rollback
| void DBConnection::setDatabase | ( | string | d | ) |
Set the database connection string
| d | The connection string |
| void DBConnection::setPassword | ( | string | p | ) |
Set the database user password
| p | The user password |
| void DBConnection::setUser | ( | string | u | ) |
Set the database user name
| u | The user name |
| void DBConnection::terminateStatement | ( | Statement * | s | ) |
Terminate the given statement.
| s | A pointer on the statement to close. |
1.4.7