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

clawsoft::SQLDriver Class Reference

#include <SQLDriver.h>

Inheritance diagram for clawsoft::SQLDriver:

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

Collaboration graph
[legend]

Detailed Description

This class is an abstract interface for dynamic loading database driver objects.

STATUS: READY TO TEST


Public Methods

 SQLDriver (const String &soname)
 Default constructor it initialzes some defaults only.

virtual ~SQLDriver ()
 Destructor, this will verify if the Driver class is still loaded, if it is then it will unload it and attempt to clear all used resources.

void load ()
 This will load the class and any required internal symbols.

void getVersionInfo (DBDriverInfo **info)
 Use this function to retrieve verion and/or vendor informaton for the driver.

virtual Uint32 connect (const String &server, const String &user, const String &pass, int port=0)
 Driver supplied database connection function, it will return a handler to the current connection if it is successfull.

virtual ResultSetquery (Uint32 __handle, const String &command)
 Use this method to send a command to the backend server.

virtual bool disconnect (Uint32 __handle)
 This method will disconnect you from the backend server if you are connected.

virtual void setAutoCommit (bool val=true)
 The use of this method will turn on autocommits, the idea is that if you issue an update or delete command this will call the commit command inmediately so there is no reason for you to call it manually everytime you need it.

virtual void commit (Uint32 __handle)
 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.

virtual void useDB (Uint32 __handle, const String &dbname)
 After connecting to the specified database server use the dbname contained therein.

virtual const int numRows (Uint32 __res_handle)
 This will return the number of rows for the current result handle.

virtual const int numCols (Uint32 __res_handle)
 This will return the number of columns for the current result handle.

SQLFieldfetchRow (Uint32 __res_handle)
 This will fetch a row of data from a result obtained after issueing a query to the RDBMS.

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.


Protected Attributes

Plugin__drv
 This is the driver handle.


Constructor & Destructor Documentation

clawsoft::SQLDriver::SQLDriver const String   soname
 

Default constructor it initialzes some defaults only.

clawsoft::SQLDriver::~SQLDriver   [virtual]
 

Destructor, this will verify if the Driver class is still loaded, if it is then it will unload it and attempt to clear all used resources.


Member Function Documentation

void clawsoft::SQLDriver::commit Uint32    __handle [virtual]
 

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.

Uint32 clawsoft::SQLDriver::connect const String   server,
const String   user,
const String   pass,
int    port = 0
[virtual]
 

Driver supplied database connection function, it will return a handler to the current connection if it is successfull.

The parameter server stands for the server IP address or hostname. user is the username as to whom be connected, pass is the password to be used and port is the port to be used if there is a need to specify it if you send the default 0 then the port used is going to be the default for the backend database.

bool clawsoft::SQLDriver::disconnect Uint32    __handle [virtual]
 

This method will disconnect you from the backend server if you are connected.

SQLField * clawsoft::SQLDriver::fetchRow Uint32    __res_handle
 

This will fetch a row of data from a result obtained after issueing a query to the RDBMS.

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

Returns the name of the current class.

void clawsoft::SQLDriver::getVersionInfo DBDriverInfo **    info
 

Use this function to retrieve verion and/or vendor informaton for the driver.

void clawsoft::SQLDriver::load  
 

This will load the class and any required internal symbols.

const int clawsoft::SQLDriver::numCols Uint32    __res_handle [virtual]
 

This will return the number of columns for the current result handle.

const int clawsoft::SQLDriver::numRows Uint32    __res_handle [virtual]
 

This will return the number of rows for the current result handle.

ResultSet * clawsoft::SQLDriver::query Uint32    __handle,
const String   command
[virtual]
 

Use this method to send a command to the backend server.

__handle is the connection handler and command is the command to be send to the backend database

void clawsoft::SQLDriver::setAutoCommit bool    val = true [virtual]
 

The use of this method will turn on autocommits, the idea is that if you issue an update or delete command this will call the commit command inmediately so there is no reason for you to call it manually everytime you need it.

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.

void clawsoft::SQLDriver::useDB Uint32    __handle,
const String   dbname
[virtual]
 

After connecting to the specified database server use the dbname contained therein.


Field Documentation

Plugin* clawsoft::SQLDriver::__drv [protected]
 

This is the driver handle.


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

Authors:

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

Powered by:

SourceForgeLogo