Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields  

clawsoft::SQLConnection Class Reference

#include <SQLConnection.h>

Inheritance diagram for clawsoft::SQLConnection:

Inheritance graph
[legend]
Collaboration diagram for clawsoft::SQLConnection:

Collaboration graph
[legend]

Detailed Description

This class encapsulates the SQLDriver class and provides a much more complete interface to the SQL database connection paradigm.

STATUS: READY TO TEST


Public Methods

 SQLConnection (SQLDriver *drv)
 This constructor will require an instatiated SQLDriver.

 SQLConnection (SQLDriver *drv, const String &server, const String &u, const String &p, int port=0)
 This constructor will initialize the internal driver also will attempt to make a connection to the backend database as soon as possible.

 ~SQLConnection ()
 cleanup routine

void connect (const String &server, const String &u, const String &p, int port=0)
 This routine will connect you to the specified server using the username u, password p and port port.

void connect ()
 This method will attempt to connect using the last username, server, password and port supplied in a call connect or the one used in the constructor.

void disconnect ()
 A call to this method will inmediately disconnect you from the backend database.

ResultSetquery (const String &cmd)
 This method will send the command cmd to the backend database, if it is a select it will return a ResultSet containing the data returned by the database.

void commit ()
 This will commit any transaction based command to the database, when you call commit every submitted delete or update they will execute each other in sequence.

const char * getClassName ()
 Returns the name of the current class.


Protected Methods

void setClassName (const char *n)
 Call this method when you need to set the name of the class you're creating, typically in it's constructor, remember that you must set the classname for every class you create, that way you can have more information while debugging.


Constructor & Destructor Documentation

clawsoft::SQLConnection::SQLConnection SQLDriver   drv
 

This constructor will require an instatiated SQLDriver.

clawsoft::SQLConnection::SQLConnection SQLDriver   drv,
const String   server,
const String   u,
const String   p,
int    port = 0
 

This constructor will initialize the internal driver also will attempt to make a connection to the backend database as soon as possible.

clawsoft::SQLConnection::~SQLConnection  
 

cleanup routine


Member Function Documentation

void clawsoft::SQLConnection::commit  
 

This will commit any transaction based command to the database, when you call commit every submitted delete or update they will execute each other in sequence.

void clawsoft::SQLConnection::connect  
 

This method will attempt to connect using the last username, server, password and port supplied in a call connect or the one used in the constructor.

void clawsoft::SQLConnection::connect const String   server,
const String   u,
const String   p,
int    port = 0
 

This routine will connect you to the specified server using the username u, password p and port port.

If the connection is not successfull this method will throw an appropiate exception.

void clawsoft::SQLConnection::disconnect  
 

A call to this method will inmediately disconnect you from the backend database.

const char * clawsoft::Object::getClassName   [inherited]
 

Returns the name of the current class.

ResultSet * clawsoft::SQLConnection::query const String   cmd
 

This method will send the command cmd to the backend database, if it is a select it will return a ResultSet containing the data returned by the database.

If it is another type of command like an update or delete or any other that does not return data or a status completion of success or failure then the returned ResultSet will not contain any data instead call the status method of the ResultSet to know if the call succeeded or not

void clawsoft::Object::setClassName const char *    n [protected, inherited]
 

Call this method when you need to set the name of the class you're creating, typically in it's constructor, remember that you must set the classname for every class you create, that way you can have more information while debugging.


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

Authors:

Juan V. Guerrero
Jannette C. Mejia
Juan C. Guevara

Powered by:

SourceForgeLogo