Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members  

ODBCQuery Class Reference

#include <ODBCQuery.h>

List of all members.

Public Methods

 ODBCQuery (ODBCConnection &odbc)
 ~ODBCQuery ()
ODBCQuery & param (bool *pValue)
ODBCQuery & param (char *pValue)
ODBCQuery & param (int *pValue)
ODBCQuery & param (int64_t *pValue)
ODBCQuery & param (const char *pValue)
ODBCQuery & binParam ()
ODBCQuery & column (bool *pValue)
ODBCQuery & column (char *pValue)
ODBCQuery & column (int *pValue)
ODBCQuery & column (int64_t *pValue)
int exec (const char *query)
void listTables ()
bool fetch ()
bool commit ()
bool rollback ()
bool getText (int column, string &str)
int getData (int column, uint8_t *buffer, int maxlen)
int putData (const uint8_t *buffer, int length)
int paramData ()
void error (int lineno)


Detailed Description

ODBC query (statement) abstraction.


Constructor & Destructor Documentation

ODBCQuery::ODBCQuery (  ODBCConnection &    odbc ) 
 

Constructor.

Parameters:
odbc  the database connection pool

ODBCQuery::~ODBCQuery (    ) 
 

Destructor.


Member Function Documentation

ODBCQuery & ODBCQuery::binParam (    ) 
 

Bind binary (LONGVARBINARY) to next paramter marker in SQL statement.

ODBCQuery & ODBCQuery::column (  int64_t *    pValue ) 
 

Bind int64_t (BIGINT) to next column in the result set.

ODBCQuery & ODBCQuery::column (  int *    pValue ) 
 

Bind int to next column in the result set.

ODBCQuery & ODBCQuery::column (  char *    pValue ) 
 

Bind char to next column in the result set.

ODBCQuery & ODBCQuery::column (  bool *    pValue ) 
 

Bind bool to next column in the result set.

bool ODBCQuery::commit (    ) 
 

Commit transaction.

Returns:
true if successful, false otherwise

void ODBCQuery::error (  int    lineno ) 
 

ODBC error, free resources associated with statement handle.

Parameters:
lineno  the line number where the error occured

int ODBCQuery::exec (  const char *    query ) 
 

Execute SQL query and compare the number of rows affected.

Parameters:
query  the SQL query to execute
Returns:
number of affected rows or -1 on error

bool ODBCQuery::fetch (    ) 
 

Fetch the next rowset of data from the result set.

Returns:
true if successful, false otherwise

int ODBCQuery::getData (  int    column,
uint8_t *    buffer,
int    maxlen
) 
 

Retrieves data for a single column in the result set.

Parameters:
column  the column number in the result set
buffer  the buffer that receives the data
maxlen  the size of the buffer
Returns:
the number of bytes actually read or -1 on failure

bool ODBCQuery::getText (  int    column,
string &    str
) 
 

Retrieve 'text' (TEXT) column.

Parameters:
column  the column number in the result set
str  the string reference that receives the 'text' value
Returns:
true is successful, false otherwise

void ODBCQuery::listTables (    ) 
 

Fetch a list of all available tables TABLE_NAME is the 3rd column

ODBCQuery & ODBCQuery::param (  const char *    pValue ) 
 

Bind 'const char *' (TEXT) to next parameter marker in SQL statement.

ODBCQuery & ODBCQuery::param (  int64_t *    pValue ) 
 

Bind int64_t (BIGINT) to next parameter marker in SQL statement.

ODBCQuery & ODBCQuery::param (  int *    pValue ) 
 

Bind int to next parameter marker in SQL statement.

ODBCQuery & ODBCQuery::param (  char *    pValue ) 
 

Bind char to next parameter marker in SQL statement.

ODBCQuery & ODBCQuery::param (  bool *    pValue ) 
 

Bind bool to next parameter marker in SQL statement.

int ODBCQuery::paramData (    ) 
 

Get next binary parameter index for putData().

Returns:
parameter index or -1 if no more data is needed

int ODBCQuery::putData (  const uint8_t *    buffer,
int    length
) 
 

Send data for a parameter or column at statement execution time.

Parameters:
buffer  the buffer that contains the data
length  the size of the buffer
Returns:
the number of bytes actually written or -1 on failure

bool ODBCQuery::rollback (    ) 
 

Rollback transaction.

Returns:
true if successful, false otherwise


The documentation for this class was generated from the following files:
Generated on Wed Feb 18 13:45:56 2004 for strongroom by doxygen1.2.18