Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

rdbModel::Connection Class Reference

#include <Connection.h>

Inheritance diagram for rdbModel::Connection:

rdbModel::MysqlConnection rdbModel::MysqlConnection List of all members.

Public Member Functions

virtual bool close ()=0
virtual bool close ()=0
virtual bool compileAssertion (const Assertion *a, std::string &sqlString) const =0
virtual bool compileAssertion (const Assertion *a, std::string &sqlString) const =0
 Connection ()
 Connection ()
virtual ResultHandledbRequest (const std::string &request)=0
virtual ResultHandledbRequest (const std::string &request)=0
virtual void disableModify (bool disable)=0
virtual void disableModify (bool disable)=0
virtual std::ostreamgetErrOut () const =0
virtual std::ostreamgetErrOut () const =0
virtual std::ostreamgetOut () const =0
virtual std::ostreamgetOut () const =0
virtual bool insertRow (const std::string &tableName, const StringVector &colNames, const StringVector &values, int *auto_value=0, const StringVector *nullCols=0)=0
virtual bool insertRow (const std::string &tableName, const StringVector &colNames, const StringVector &values, int *auto_value=0, const StringVector *nullCols=0)=0
virtual bool isConnected ()=0
 Return true iff open has been done with no matching close.
virtual bool isConnected ()=0
 Return true iff open has been done with no matching close.
virtual MATCH matchSchema (Rdb *rdb, bool matchDbName=true)=0
virtual MATCH matchSchema (Rdb *rdb, bool matchDbName=true)=0
virtual bool open (const std::string &parms)=0
virtual bool open (const std::string &host, const std::string &userid, const std::string &password, const std::string &dbName)=0
virtual bool open (const std::string &parms)=0
virtual bool open (const std::string &host, const std::string &userid, const std::string &password, const std::string &dbName)=0
virtual ResultHandleselect (const std::string &tableName, const StringVector &getCols, const StringVector &orderCols, const Assertion *where=0, int rowLimit=0, int rowOffset=0)=0
virtual ResultHandleselect (const std::string &tableName, const StringVector &getCols, const StringVector &orderCols, const Assertion *where=0, int rowLimit=0, int rowOffset=0)=0
virtual unsigned int update (const std::string &tableName, const StringVector &colNames, const StringVector &values, const Assertion *where=0, const StringVector *nullCols=0)=0
virtual unsigned int update (const std::string &tableName, const StringVector &colNames, const StringVector &values, const Assertion *where=0, const StringVector *nullCols=0)=0
virtual ~Connection ()
virtual ~Connection ()

Constructor & Destructor Documentation

rdbModel::Connection::Connection  )  [inline]
 

Open a connection Allowed operations will depend on userid, etc., specified return true if successful

00060 {};

virtual rdbModel::Connection::~Connection  )  [inline, virtual]
 

00061 {};

rdbModel::Connection::Connection  )  [inline]
 

Open a connection Allowed operations will depend on userid, etc., specified return true if successful

00060 {};

virtual rdbModel::Connection::~Connection  )  [inline, virtual]
 

00061 {};


Member Function Documentation

virtual bool rdbModel::Connection::close  )  [pure virtual]
 

Close the current open connection , if any. Return true if there was a connection to close and it was closed successfully

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual bool rdbModel::Connection::close  )  [pure virtual]
 

Close the current open connection , if any. Return true if there was a connection to close and it was closed successfully

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual bool rdbModel::Connection::compileAssertion const Assertion a,
std::string &  sqlString
const [pure virtual]
 

compile method for assertions. Use it internally, but also make it publicly available so assertions belonging to a table can save the compiled version.

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual bool rdbModel::Connection::compileAssertion const Assertion a,
std::string &  sqlString
const [pure virtual]
 

compile method for assertions. Use it internally, but also make it publicly available so assertions belonging to a table can save the compiled version.

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual ResultHandle* rdbModel::Connection::dbRequest const std::string &  request  )  [pure virtual]
 

Transmit raw request of any form to database. If it is a request that returns results, those results will be stored in a newly- allocated ResultHandle and dbRequest will return a pointer to it. Otherwise dbRequest will return a null pointer. Throw an exception if request fails for any reason.

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual ResultHandle* rdbModel::Connection::dbRequest const std::string &  request  )  [pure virtual]
 

Transmit raw request of any form to database. If it is a request that returns results, those results will be stored in a newly- allocated ResultHandle and dbRequest will return a pointer to it. Otherwise dbRequest will return a null pointer. Throw an exception if request fails for any reason.

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual void rdbModel::Connection::disableModify bool  disable  )  [pure virtual]
 

Turn select and update into no-ops: output SQL string for debugging but don't change db

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual void rdbModel::Connection::disableModify bool  disable  )  [pure virtual]
 

Turn select and update into no-ops: output SQL string for debugging but don't change db

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual std::ostream* rdbModel::Connection::getErrOut  )  const [pure virtual]
 

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual std::ostream* rdbModel::Connection::getErrOut  )  const [pure virtual]
 

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual std::ostream* rdbModel::Connection::getOut  )  const [pure virtual]
 

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual std::ostream* rdbModel::Connection::getOut  )  const [pure virtual]
 

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual bool rdbModel::Connection::insertRow const std::string &  tableName,
const StringVector colNames,
const StringVector values,
int *  auto_value = 0,
const StringVector nullCols = 0
[pure virtual]
 

Typical derived class will form a syntactically correct INSERT statement from the input arguments and issue it to the dbms. Return true if row was inserted successfully

Might also want to add a routine for INSERT ... SELECT

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual bool rdbModel::Connection::insertRow const std::string &  tableName,
const StringVector colNames,
const StringVector values,
int *  auto_value = 0,
const StringVector nullCols = 0
[pure virtual]
 

Typical derived class will form a syntactically correct INSERT statement from the input arguments and issue it to the dbms. Return true if row was inserted successfully

Might also want to add a routine for INSERT ... SELECT

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual bool rdbModel::Connection::isConnected  )  [pure virtual]
 

Return true iff open has been done with no matching close.

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual bool rdbModel::Connection::isConnected  )  [pure virtual]
 

Return true iff open has been done with no matching close.

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual MATCH rdbModel::Connection::matchSchema Rdb rdb,
bool  matchDbName = true
[pure virtual]
 

Check to what degree local schema definition is compatible with remote db accessed via this connection. By default check db names match, but this may be disabled.

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual MATCH rdbModel::Connection::matchSchema Rdb rdb,
bool  matchDbName = true
[pure virtual]
 

Check to what degree local schema definition is compatible with remote db accessed via this connection. By default check db names match, but this may be disabled.

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual bool rdbModel::Connection::open const std::string &  parms  )  [pure virtual]
 

Parameter is normally path for an xml file descrbing the connection parameters

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual bool rdbModel::Connection::open const std::string &  host,
const std::string &  userid,
const std::string &  password,
const std::string &  dbName
[pure virtual]
 

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual bool rdbModel::Connection::open const std::string &  parms  )  [pure virtual]
 

Parameter is normally path for an xml file descrbing the connection parameters

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual bool rdbModel::Connection::open const std::string &  host,
const std::string &  userid,
const std::string &  password,
const std::string &  dbName
[pure virtual]
 

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual ResultHandle* rdbModel::Connection::select const std::string &  tableName,
const StringVector getCols,
const StringVector orderCols,
const Assertion where = 0,
int  rowLimit = 0,
int  rowOffset = 0
[pure virtual]
 

Support only for relatively simple SELECT, involving just one table.

Parameters:
tableName 
getCols vector of columns to be retrieved
where ptr to an Assertion object
rowLimit max number of rows to return
rowOffset offset for first row returned among those satisfying conditions; ignored if 0.
Returns:
If the SELECT succeeds, a pointer to an object which manages the returned data; else 0. Caller is responsible for deleting the ResultHandle object.

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual ResultHandle* rdbModel::Connection::select const std::string &  tableName,
const StringVector getCols,
const StringVector orderCols,
const Assertion where = 0,
int  rowLimit = 0,
int  rowOffset = 0
[pure virtual]
 

Support only for relatively simple SELECT, involving just one table.

Parameters:
tableName 
getCols vector of columns to be retrieved
where ptr to an Assertion object
rowLimit max number of rows to return
rowOffset offset for first row returned among those satisfying conditions; ignored if 0.
Returns:
If the SELECT succeeds, a pointer to an object which manages the returned data; else 0. Caller is responsible for deleting the ResultHandle object.

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual unsigned int rdbModel::Connection::update const std::string &  tableName,
const StringVector colNames,
const StringVector values,
const Assertion where = 0,
const StringVector nullCols = 0
[pure virtual]
 

Generic UPDATE. Return value is number of rows changed.

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.

virtual unsigned int rdbModel::Connection::update const std::string &  tableName,
const StringVector colNames,
const StringVector values,
const Assertion where = 0,
const StringVector nullCols = 0
[pure virtual]
 

Generic UPDATE. Return value is number of rows changed.

Implemented in rdbModel::MysqlConnection, and rdbModel::MysqlConnection.


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 19:22:05 2011 for BOSS6.5.5 by  doxygen 1.3.9.1